Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::NarInfoDiskCache Struct Referenceabstract
Inheritance diagram for nix::NarInfoDiskCache:
nix::NarInfoDiskCacheImpl

Classes

struct  CacheInfo

Public Types

enum  Outcome { oValid , oInvalid , oUnknown }
using Settings = NarInfoDiskCacheSettings

Public Member Functions

 NarInfoDiskCache (const Settings &settings)
virtual int createCache (const std::string &uri, const std::string &storeDir, const CacheInfo &info)=0
virtual std::optional< CacheInfo > upToDateCacheExists (const std::string &uri)=0
virtual std::pair< Outcome, std::shared_ptr< NarInfo > > lookupNarInfo (const std::string &uri, const std::string &hashPart)=0
virtual void upsertNarInfo (const std::string &uri, const std::string &hashPart, std::shared_ptr< const ValidPathInfo > info)=0
virtual void upsertRealisation (const std::string &uri, const Realisation &realisation)=0
virtual void upsertAbsentRealisation (const std::string &uri, const DrvOutput &id)=0
virtual std::pair< Outcome, std::shared_ptr< Realisation > > lookupRealisation (const std::string &uri, const DrvOutput &id)=0

Static Public Member Functions

static ref< NarInfoDiskCache > get (const Settings &settings, SQLiteSettings)
static ref< NarInfoDiskCache > getTest (const Settings &settings, SQLiteSettings, std::filesystem::path dbPath)

Public Attributes

const Settings & settings

Member Function Documentation

◆ createCache()

virtual int nix::NarInfoDiskCache::createCache ( const std::string & uri,
const std::string & storeDir,
const CacheInfo & info )
pure virtual

Create or update the cached nix-cache-info for the binary cache at uri. Note that info.id is ignored. This function returns the id of the cache entry.

Implemented in nix::NarInfoDiskCacheImpl.

◆ get()

ref< NarInfoDiskCache > nix::NarInfoDiskCache::get ( const Settings & settings,
SQLiteSettings sqliteSettings )
static

Return a singleton cache object that can be used concurrently by multiple threads.

Note
the parameters are only used to initialize this the first time this is called. In subsequent calls, these arguments are ignored.
Todo
Probably should instead create a memo table so multiple settings -> multiple instances, but this is not yet a problem in practice.

The documentation for this struct was generated from the following files: