2020-08-24 16:54:16 +00:00
|
|
|
#include "store-api.hh"
|
|
|
|
|
|
|
|
namespace nix {
|
|
|
|
|
|
|
|
struct DummyStore : public Store
|
|
|
|
{
|
2020-09-08 12:50:23 +00:00
|
|
|
DummyStore(const std::string uri, const Params & params)
|
2020-08-24 16:54:16 +00:00
|
|
|
: Store(params)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
string getUri() override
|
|
|
|
{
|
2020-09-08 12:50:23 +00:00
|
|
|
return uriPrefixes()[0] + "://";
|
2020-08-24 16:54:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void queryPathInfoUncached(const StorePath & path,
|
|
|
|
Callback<std::shared_ptr<const ValidPathInfo>> callback) noexcept override
|
|
|
|
{
|
|
|
|
callback(nullptr);
|
|
|
|
}
|
|
|
|
|
2020-09-08 12:50:23 +00:00
|
|
|
static std::vector<std::string> uriPrefixes() {
|
|
|
|
return {"dummy"};
|
|
|
|
}
|
|
|
|
|
2020-08-24 16:54:16 +00:00
|
|
|
std::optional<StorePath> queryPathFromHashPart(const std::string & hashPart) override
|
|
|
|
{ unsupported("queryPathFromHashPart"); }
|
|
|
|
|
|
|
|
void addToStore(const ValidPathInfo & info, Source & source,
|
|
|
|
RepairFlag repair, CheckSigsFlag checkSigs) override
|
|
|
|
{ unsupported("addToStore"); }
|
|
|
|
|
|
|
|
StorePath addToStore(const string & name, const Path & srcPath,
|
|
|
|
FileIngestionMethod method, HashType hashAlgo,
|
|
|
|
PathFilter & filter, RepairFlag repair) override
|
|
|
|
{ unsupported("addToStore"); }
|
|
|
|
|
|
|
|
StorePath addTextToStore(const string & name, const string & s,
|
|
|
|
const StorePathSet & references, RepairFlag repair) override
|
|
|
|
{ unsupported("addTextToStore"); }
|
|
|
|
|
|
|
|
void narFromPath(const StorePath & path, Sink & sink) override
|
|
|
|
{ unsupported("narFromPath"); }
|
|
|
|
|
|
|
|
void ensurePath(const StorePath & path) override
|
|
|
|
{ unsupported("ensurePath"); }
|
|
|
|
|
|
|
|
BuildResult buildDerivation(const StorePath & drvPath, const BasicDerivation & drv,
|
|
|
|
BuildMode buildMode) override
|
|
|
|
{ unsupported("buildDerivation"); }
|
|
|
|
};
|
|
|
|
|
2020-09-08 12:50:23 +00:00
|
|
|
[[maybe_unused]] static RegisterStoreImplementation<DummyStore> regStore();
|
2020-08-24 16:54:16 +00:00
|
|
|
|
|
|
|
}
|