operator

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteLocal added in v0.2.0

func ExecuteLocal(callback Callback) error

func ExecuteRemote added in v0.2.0

func ExecuteRemote(host string, user string, privateKey string, callback Callback) error

Types

type Callback added in v0.2.0

type Callback func(CommandOperator) error

type CommandOperator

type CommandOperator interface {
	Execute(command string) (CommandRes, error)
	Upload(src io.Reader, remotePath string, mode string) error
	UploadFile(path string, remotePath string, mode string) error
}

type CommandRes

type CommandRes struct {
	StdOut []byte
	StdErr []byte
}

type LocalOperator added in v0.2.0

type LocalOperator struct {
}

func NewLocalOperator added in v0.2.0

func NewLocalOperator() *LocalOperator

func (LocalOperator) Execute added in v0.2.0

func (e LocalOperator) Execute(command string) (CommandRes, error)

func (LocalOperator) Upload added in v0.2.0

func (e LocalOperator) Upload(source io.Reader, remotePath string, mode string) error

func (LocalOperator) UploadFile added in v0.2.0

func (e LocalOperator) UploadFile(path string, remotePath string, mode string) error

type SSHOperator

type SSHOperator struct {
	// contains filtered or unexported fields
}

func NewSSHOperator

func NewSSHOperator(address string, config *ssh.ClientConfig) (*SSHOperator, error)

func (SSHOperator) Close

func (s SSHOperator) Close() error

func (SSHOperator) Execute

func (s SSHOperator) Execute(command string) (CommandRes, error)

func (SSHOperator) Upload

func (s SSHOperator) Upload(source io.Reader, remotePath string, mode string) error

func (SSHOperator) UploadFile

func (s SSHOperator) UploadFile(path string, remotePath string, mode string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL