Skip to main content

Module cache

Module cache 

Source
Expand description

Generic persistent-cache primitives.

A string key/value store with tags, mirroring the C# Proton.Sdk.Caching layer: the CacheRepository trait (C# ICacheRepository), an in-memory implementation (InMemoryCacheRepository, C# InMemoryCacheRepository), and an at-rest-encryption wrapper (EncryptedCacheRepository, C# EncryptedCacheRepository).

Higher layers (the Drive entity/secret caches) serialize typed values to JSON strings and store them here; a consumer can supply an on-disk implementation of CacheRepository (e.g. SQLite) without changing those layers.

Structs§

EncryptedCacheRepository
At-rest-encryption wrapper around any CacheRepository. Mirrors C# EncryptedCacheRepository.
InMemoryCacheRepository
Thread-safe in-memory CacheRepository. Mirrors C# InMemoryCacheRepository, with an LRU bound the C# version does not have.

Constants§

DEFAULT_CACHE_CAPACITY
Default entry ceiling for InMemoryCacheRepository.

Traits§

CacheRepository
A string key/value cache with secondary tag indexing.

Functions§

set_untagged
Convenience: store a value with no tags.