Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
remote-fs-accessor.hh
Go to the documentation of this file.
1#pragma once
3
4#include "nix/util/source-accessor.hh"
5#include "nix/util/ref.hh"
6#include "nix/util/nar-cache.hh"
8
9namespace nix {
10
11class RemoteFSAccessor : public SourceAccessor
12{
13 void anchor() override;
14
15 ref<Store> store;
16
22 std::map<std::string, Hash, std::less<>> narHashes;
23
24 NarCache narCache;
25
26 bool requireValidPath;
27
28 std::pair<ref<SourceAccessor>, CanonPath> fetch(const CanonPath & path);
29
30 friend struct BinaryCacheStore;
31
32public:
33
39 std::shared_ptr<SourceAccessor> accessObject(const StorePath & path);
40
41 RemoteFSAccessor(ref<Store> store, bool requireValidPath = true, std::optional<AbsolutePath> cacheDir = {});
42
43 std::optional<Stat> maybeLstat(const CanonPath & path) override;
44
45 DirEntries readDirectory(const CanonPath & path) override;
46
47 void readFile(const CanonPath & path, Sink & sink, fun<void(uint64_t)> sizeCallback) override;
48
50
51 std::string readLink(const CanonPath & path) override;
52};
53
54} // namespace nix
Definition canon-path.hh:50
Definition nar-cache.hh:20
std::shared_ptr< SourceAccessor > accessObject(const StorePath &path)
Definition remote-fs-accessor.cc:22
void readFile(const CanonPath &path, Sink &sink, fun< void(uint64_t)> sizeCallback) override
Definition remote-fs-accessor.cc:54
DirEntries readDirectory(const CanonPath &path) override
Definition remote-fs-accessor.cc:48
Definition path.hh:33
Definition fun.hh:19
Definition ref.hh:58
Definition serialise.hh:18
std::string readFile(const CanonPath &path)
Definition source-accessor.cc:62