Documentation ¶
Index ¶
- Variables
- type ExecClient
- type IMachine
- type Machine
- func (m *Machine) Close()
- func (m *Machine) FetchDir(localDir, remoteDir string, fileNeeded func(path string) bool) error
- func (m *Machine) FetchFile(dst io.Writer, remotePath string) error
- func (m *Machine) FetchFileToLocalPath(localPath, remotePath string) error
- func (m *Machine) GetIp() string
- func (m *Machine) GetName() string
- func (m *Machine) GetNode() *pb.Node
- func (m *Machine) PutDir(localDir, remoteDir string, fileNeeded func(path string) bool) error
- func (m *Machine) PutFile(content io.Reader, remotePath string) error
- func (m *Machine) Run(cmd string) (stdout, stderr []byte, err error)
- type MockMachine
- func (m *MockMachine) Close()
- func (m *MockMachine) FetchDir(localDir, remoteDir string, fileNeeded func(path string) bool) error
- func (m *MockMachine) FetchFile(dst io.Writer, remotePath string) error
- func (m *MockMachine) FetchFileToLocalPath(localPath, remotePath string) error
- func (m *MockMachine) GetIp() string
- func (m *MockMachine) GetName() string
- func (m *MockMachine) GetNode() *pb.Node
- func (m *MockMachine) PutDir(localDir, remoteDir string, fileNeeded func(path string) bool) error
- func (m *MockMachine) PutFile(content io.Reader, remotePath string) error
- func (m *MockMachine) Run(cmd string) (stdout, stderr []byte, err error)
- func (m *MockMachine) StartDockerTunnel() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //IsTesting only set it in test package IsTesting = false )
Functions ¶
This section is empty.
Types ¶
type ExecClient ¶
func NewExecClient ¶
func NewExecClient(node *pb.Node) (*ExecClient, error)
NewExecClient create a new execution client
func (*ExecClient) Close ¶
func (m *ExecClient) Close()
Close will only close ssh client no need to close sftp client since it's based on ssh client
func (*ExecClient) ReadFile ¶
func (m *ExecClient) ReadFile(filename string) (content []byte, err error)
ReadFile reads the file named by filename and returns the contents. A successful call returns err == nil, not err == EOF. Because ReadFile reads the whole file, it does not treat an EOF from Read as an error to be reported. Like ioutil.ReadFile
type IMachine ¶
type IMachine interface { GetName() string GetIp() string GetNode() *pb.Node Close() Run(cmd string) (stdout, stderr []byte, err error) FetchDir(localDir, remoteDir string, fileNeeded func(path string) bool) error FetchFile(dst io.Writer, remotePath string) error FetchFileToLocalPath(localPath, remotePath string) error PutDir(localDir, remoteDir string, fileNeeded func(path string) bool) error PutFile(content io.Reader, remotePath string) error }
type Machine ¶
type Machine struct { *ExecClient *pb.Node }
func (*Machine) FetchFileToLocalPath ¶
type MockMachine ¶
type MockMachine struct { *pb.Node DockerClient *dockerclient.Client }
func (*MockMachine) Close ¶
func (m *MockMachine) Close()
func (*MockMachine) FetchDir ¶
func (m *MockMachine) FetchDir(localDir, remoteDir string, fileNeeded func(path string) bool) error
func (*MockMachine) FetchFile ¶
func (m *MockMachine) FetchFile(dst io.Writer, remotePath string) error
func (*MockMachine) FetchFileToLocalPath ¶
func (m *MockMachine) FetchFileToLocalPath(localPath, remotePath string) error
func (*MockMachine) GetIp ¶
func (m *MockMachine) GetIp() string
func (*MockMachine) GetName ¶
func (m *MockMachine) GetName() string
func (*MockMachine) GetNode ¶
func (m *MockMachine) GetNode() *pb.Node
func (*MockMachine) PutDir ¶
func (m *MockMachine) PutDir(localDir, remoteDir string, fileNeeded func(path string) bool) error
func (*MockMachine) PutFile ¶
func (m *MockMachine) PutFile(content io.Reader, remotePath string) error
func (*MockMachine) Run ¶
func (m *MockMachine) Run(cmd string) (stdout, stderr []byte, err error)
Run return different response by node name
func (*MockMachine) StartDockerTunnel ¶
func (m *MockMachine) StartDockerTunnel() error
Click to show internal directories.
Click to hide internal directories.