From fd2409613744fb8e93a392d312cb0985f18f23b1 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Sat, 29 Apr 2017 20:09:09 +0200 Subject: [PATCH] Decouple model and sshbytestream. --- model/model.go | 8 -------- sshbytestream/ssh.go | 11 +++++++++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/model/model.go b/model/model.go index 661b8e9..7844bae 100644 --- a/model/model.go +++ b/model/model.go @@ -19,11 +19,3 @@ type Snapshot struct { type Pool struct { Root Filesystem } - -type SSHTransport struct { - Host string - User string - Port uint16 - TransportOpenCommand []string - Options []string -} diff --git a/sshbytestream/ssh.go b/sshbytestream/ssh.go index d8a7cfa..bf9b239 100644 --- a/sshbytestream/ssh.go +++ b/sshbytestream/ssh.go @@ -4,13 +4,20 @@ import ( "bytes" "context" "fmt" - "github.com/zrepl/zrepl/model" "io" "os" "os/exec" "sync" ) +type SSHTransport struct { + Host string + User string + Port uint16 + TransportOpenCommand []string + Options []string +} + var SSHCommand string = "ssh" func Incoming() (wc io.ReadWriteCloser, err error) { @@ -33,7 +40,7 @@ func (f IncomingReadWriteCloser) Close() (err error) { return nil } -func Outgoing(name string, remote model.SSHTransport) (conn io.ReadWriteCloser, err error) { +func Outgoing(remote SSHTransport) (conn io.ReadWriteCloser, err error) { ctx, cancel := context.WithCancel(context.Background())