about summary refs log tree commit diff
path: root/src/libstore/ssh-store.hh
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2016-09-02T18·31-0400
committerShea Levy <shea@shealevy.com>2016-09-02T18·31-0400
commitecba88de9367f733610121fc0153310f92e05b65 (patch)
tree8f27af7beac0959304468dd74aa581815489a76d /src/libstore/ssh-store.hh
parentb4b5e9ce2f58aecea2fe3ca1fe9388e4fc7df556 (diff)
Add ssh store implementation
Diffstat (limited to 'src/libstore/ssh-store.hh')
-rw-r--r--src/libstore/ssh-store.hh40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/libstore/ssh-store.hh b/src/libstore/ssh-store.hh
new file mode 100644
index 000000000000..44ece559853b
--- /dev/null
+++ b/src/libstore/ssh-store.hh
@@ -0,0 +1,40 @@
+#pragma once
+
+#include "store-api.hh"
+#include "remote-store.hh"
+
+namespace nix {
+
+class SSHStore : public RemoteStore
+{
+public:
+
+    SSHStore(string uri, const Params & params, size_t maxConnections = std::numeric_limits<size_t>::max());
+
+    std::string getUri() override;
+
+    void narFromPath(const Path & path, Sink & sink) override;
+
+    ref<FSAccessor> getFSAccessor() override;
+
+private:
+
+    struct Connection : RemoteStore::Connection
+    {
+        Pid sshPid;
+        AutoCloseFD out;
+        AutoCloseFD in;
+    };
+
+    ref<RemoteStore::Connection> openConnection() override;
+
+    AutoDelete tmpDir;
+
+    Path socketPath;
+
+    Pid sshMaster;
+
+    string uri;
+};
+
+}