Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
remote-fs-accessor.hh
Go to the documentation of this file.
1#pragma once
3
5#include "lix/libutil/ref.hh"
7
8namespace nix {
9
10class RemoteFSAccessor : public FSAccessor
11{
12 ref<Store> store;
13
14 std::map<std::string, ref<FSAccessor>> nars;
15
16 Path cacheDir;
17
18 kj::Promise<Result<std::pair<ref<FSAccessor>, Path>>>
19 fetch(const Path & path_, bool requireValidPath = true);
20
21 friend class BinaryCacheStore;
22
23 Path makeCacheFile(std::string_view hashPart, const std::string & ext);
24
25 kj::Promise<Result<ref<FSAccessor>>> addToCache(std::string_view hashPart, std::string && nar);
26
27public:
28
29 RemoteFSAccessor(ref<Store> store,
30 const /* FIXME: use std::optional */ Path & cacheDir = "");
31
32 kj::Promise<Result<Stat>> stat(const Path & path) override;
33
34 kj::Promise<Result<StringSet>> readDirectory(const Path & path) override;
35
36 kj::Promise<Result<std::string>>
37 readFile(const Path & path, bool requireValidPath = true) override;
38
39 kj::Promise<Result<std::string>> readLink(const Path & path) override;
40};
41
42}
Definition fs-accessor.hh:15
kj::Promise< Result< std::string > > readFile(const Path &path, bool requireValidPath=true) override
Definition remote-fs-accessor.cc:127
Definition ref.hh:19
std::string Path
Definition types.hh:28