mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Inline ssh-store.hh into ssh-store.cc
This commit is contained in:
parent
584f8a62de
commit
ab31f9986c
2 changed files with 34 additions and 41 deletions
|
@ -1,4 +1,5 @@
|
|||
#include "ssh-store.hh"
|
||||
#include "store-api.hh"
|
||||
#include "remote-store.hh"
|
||||
#include "remote-fs-accessor.hh"
|
||||
#include "archive.hh"
|
||||
#include "worker-protocol.hh"
|
||||
|
@ -6,6 +7,38 @@
|
|||
|
||||
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;
|
||||
};
|
||||
|
||||
SSHStore::SSHStore(string uri, const Params & params, size_t maxConnections)
|
||||
: Store(params)
|
||||
, RemoteStore(params, maxConnections)
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
#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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in a new issue