#include <cache.hh>
Classes | |
struct | Result |
struct | ResultWithStorePath |
Public Types | |
using | Domain = std::string_view |
using | Key = std::pair<Domain, Attrs> |
Public Member Functions | |
virtual void | upsert (const Key &key, const Attrs &value)=0 |
virtual std::optional< Attrs > | lookup (const Key &key)=0 |
virtual std::optional< Attrs > | lookupWithTTL (const Key &key)=0 |
virtual std::optional< Result > | lookupExpired (const Key &key)=0 |
virtual void | upsert (Key key, Store &store, Attrs value, const StorePath &storePath)=0 |
virtual std::optional< ResultWithStorePath > | lookupStorePath (Key key, Store &store)=0 |
virtual std::optional< ResultWithStorePath > | lookupStorePathWithTTL (Key key, Store &store)=0 |
using nix::fetchers::Cache::Domain = std::string_view |
A domain is a partition of the key/value cache for a particular purpose, e.g. git revision to revcount.
using nix::fetchers::Cache::Key = std::pair<Domain, Attrs> |
A cache key is a domain and an arbitrary set of attributes.
Look up a key with infinite TTL.
Implemented in nix::fetchers::CacheImpl.
Look up a key. Return a bool denoting whether its TTL has exceeded settings.tarballTTL
.
Implemented in nix::fetchers::CacheImpl.
|
pure virtual |
Look up a store path in the cache. The returned store path will be valid, but it may be expired.
Implemented in nix::fetchers::CacheImpl.
|
pure virtual |
Look up a store path in the cache. Return nothing if its TTL has exceeded settings.tarballTTL
.
Implemented in nix::fetchers::CacheImpl.
Look up a key. Return nothing if its TTL has exceeded settings.tarballTTL
.
Implemented in nix::fetchers::CacheImpl.
Add a key/value pair to the cache.
Implemented in nix::fetchers::CacheImpl.
|
pure virtual |
Insert a cache entry that has a store path associated with it. Such cache entries are always considered stale if the associated store path is invalid.
Implemented in nix::fetchers::CacheImpl.