Files
lix/lix/libfetchers/cache.hh
T
eldritch horrors 70026b1696 libfetchers: asyncify Cache::lookup{,Expired}
Change-Id: I0c2b364ebf7051b3118366b4e8c2b52860d5ce09
2025-02-08 17:26:19 +00:00

39 lines
776 B
C++

#pragma once
///@file
#include "lix/libfetchers/fetchers.hh"
#include "lix/libstore/path.hh"
namespace nix::fetchers {
struct Cache
{
virtual ~Cache() { }
virtual void add(
ref<Store> store,
const Attrs & inAttrs,
const Attrs & infoAttrs,
const StorePath & storePath,
bool locked) = 0;
virtual kj::Promise<Result<std::optional<std::pair<Attrs, StorePath>>>> lookup(
ref<Store> store,
const Attrs & inAttrs) = 0;
struct LookupResult
{
bool expired = false;
Attrs infoAttrs;
StorePath storePath;
};
virtual kj::Promise<Result<std::optional<LookupResult>>> lookupExpired(
ref<Store> store,
const Attrs & inAttrs) = 0;
};
ref<Cache> getCache();
}