Skip to main content

Module cache

Module cache 

Source
Expand description

Filesystem-level cache manager.

Responsibilities:

  • Deterministically map AssetContext values to on-disk paths
  • Store / load / delete file blobs
  • Compute SHA-256 checksums

The cache manager is unaware of the index — the higher-level crate::manager::AssetManager combines the two. This split keeps the filesystem concerns testable in isolation.

Structs§

CacheManager
Manages the physical cache directory layout and file I/O.
StoredFile
Metadata returned from CacheManager::store.

Constants§

DIR_CHATS
Directory name used for messenger chat attachments.
DIR_ISSUES
Directory name used under the cache root for issue attachments.
DIR_ISSUE_COMMENTS
Directory name used for issue comment attachments.
DIR_KB
Directory name used for knowledge base attachments.
DIR_MERGE_REQUESTS
Directory name used for merge request attachments.
DIR_MR_COMMENTS
Directory name used for MR note/comment attachments.

Functions§

resolve_under_root
Validate that a cached-asset local_path stays under root and return the absolute path on success.
sha256_hex
Compute SHA-256 of a byte slice, returned as lower-case hex.