sshrunner

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLocalPathIsFile = "local path cannot be a file when remote path is directory"
)

Functions

This section is empty.

Types

type SSHClient added in v0.6.0

type SSHClient struct {
	User       string
	Password   string
	SSHKeyPath string
	Host       string
	Port       int
	// contains filtered or unexported fields
}

func NewSSHClient added in v0.6.0

func NewSSHClient(user, password, sshKeyPath, host string, port int) *SSHClient

func (*SSHClient) Close added in v0.6.0

func (sc *SSHClient) Close()

Close release resources

func (*SSHClient) ExecInteractiveCmd added in v0.6.0

func (sc *SSHClient) ExecInteractiveCmd(cmd string) error

ExecInteractiveCmd exec command with interactive

func (*SSHClient) ExecNointeractiveCmd added in v0.6.0

func (sc *SSHClient) ExecNointeractiveCmd(cmd string, timeout time.Duration) (status runner.OutputStaus, stdout, stderr *bytes.Buffer, err error)

ExecNointeractiveCmd exec command without interactive

func (*SSHClient) Get added in v0.6.0

func (sc *SSHClient) Get(localPath, remotePath string) error

Get transfer file/directory from remote server

func (*SSHClient) Put added in v0.6.0

func (sc *SSHClient) Put(localPath, remotePath string) error

Put transfer file/directory to remote server

type SSHRunner

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

SSHRunner execute command by ssh

func New

func New(user, password, sshKeyPath, host string, port int) *SSHRunner

func (*SSHRunner) ConcurrentExec added in v0.4.0

func (sr *SSHRunner) ConcurrentExec(input runner.ExecInput, outputChan chan *runner.ConcurrentOutput, limitChan chan int)

ConcurrentExec execute command sync

func (*SSHRunner) Login added in v0.5.0

func (sr *SSHRunner) Login(shell string) error

Login login to remote server

func (*SSHRunner) SyncExec

func (sr *SSHRunner) SyncExec(input runner.ExecInput) *runner.ExecOutput

SyncExec execute command sync

func (*SSHRunner) SyncGet added in v0.6.0

func (sr *SSHRunner) SyncGet(input runner.RcpInput) *runner.RcpOutput

SyncGet copy file from remote server sync

func (*SSHRunner) SyncPut added in v0.6.0

func (sr *SSHRunner) SyncPut(input runner.RcpInput) *runner.RcpOutput

SyncPut copy file to remote server sync

Jump to

Keyboard shortcuts

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