mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-22 08:23:50 +01:00
Decouple model and sshbytestream.
This commit is contained in:
parent
9edc2005ea
commit
fd24096137
@ -19,11 +19,3 @@ type Snapshot struct {
|
|||||||
type Pool struct {
|
type Pool struct {
|
||||||
Root Filesystem
|
Root Filesystem
|
||||||
}
|
}
|
||||||
|
|
||||||
type SSHTransport struct {
|
|
||||||
Host string
|
|
||||||
User string
|
|
||||||
Port uint16
|
|
||||||
TransportOpenCommand []string
|
|
||||||
Options []string
|
|
||||||
}
|
|
||||||
|
@ -4,13 +4,20 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/zrepl/zrepl/model"
|
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type SSHTransport struct {
|
||||||
|
Host string
|
||||||
|
User string
|
||||||
|
Port uint16
|
||||||
|
TransportOpenCommand []string
|
||||||
|
Options []string
|
||||||
|
}
|
||||||
|
|
||||||
var SSHCommand string = "ssh"
|
var SSHCommand string = "ssh"
|
||||||
|
|
||||||
func Incoming() (wc io.ReadWriteCloser, err error) {
|
func Incoming() (wc io.ReadWriteCloser, err error) {
|
||||||
@ -33,7 +40,7 @@ func (f IncomingReadWriteCloser) Close() (err error) {
|
|||||||
return nil
|
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())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user