Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nar-info-disk-cache.hh
Go to the documentation of this file.
1#pragma once
3
4#include "ref.hh"
5#include "nar-info.hh"
6#include "realisation.hh"
7
8namespace nix {
9
11{
12public:
13 typedef enum { oValid, oInvalid, oUnknown } Outcome;
14
15 virtual ~NarInfoDiskCache() { }
16
17 virtual int createCache(const std::string & uri, const Path & storeDir,
18 bool wantMassQuery, int priority) = 0;
19
20 struct CacheInfo
21 {
22 int id;
23 bool wantMassQuery;
24 int priority;
25 };
26
27 virtual std::optional<CacheInfo> upToDateCacheExists(const std::string & uri) = 0;
28
29 virtual std::pair<Outcome, std::shared_ptr<NarInfo>> lookupNarInfo(
30 const std::string & uri, const std::string & hashPart) = 0;
31
32 virtual void upsertNarInfo(
33 const std::string & uri, const std::string & hashPart,
34 std::shared_ptr<const ValidPathInfo> info) = 0;
35
36 virtual void upsertRealisation(
37 const std::string & uri,
38 const Realisation & realisation) = 0;
39 virtual void upsertAbsentRealisation(
40 const std::string & uri,
41 const DrvOutput & id) = 0;
42 virtual std::pair<Outcome, std::shared_ptr<Realisation>> lookupRealisation(
43 const std::string & uri, const DrvOutput & id) = 0;
44};
45
50ref<NarInfoDiskCache> getNarInfoDiskCache();
51
52ref<NarInfoDiskCache> getTestNarInfoDiskCache(Path dbPath);
53
54}
Definition nar-info-disk-cache.hh:11
Definition ref.hh:15
Definition realisation.hh:24
Definition nar-info-disk-cache.hh:21
Definition realisation.hh:49
std::string Path
Definition types.hh:22