koi_net.components.cache
Classes
|
Default storage component for a KOI node. |
- class koi_net.components.cache.Cache(config, root_dir)[source]
Bases:
objectDefault storage component for a KOI node.
Stores bundles as JSON documents within a cache directory, where the filename is the base-64 encoding of an RID.
- Parameters:
config (BaseNodeConfig)
root_dir (Path)
- config: BaseNodeConfig
- property directory_path
- list_rids(rid_types=None)[source]
Returns a list of the RIDs of all bundles in cache.
- Return type:
list[RID]- Parameters:
rid_types (list[RIDType] | None)
- read(rid)[source]
Attempts to read an RIDed
Bundlefrom cache.- Return type:
Bundle|None- Parameters:
rid (RID)
- root_dir: Path