sshrunner

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type SFTPClient added in v0.6.5

type SFTPClient struct {
	FileTransBuf int
	// contains filtered or unexported fields
}

func NewSFTPClient added in v0.6.5

func NewSFTPClient(sc *SSHClient, fileTransBuf int) *SFTPClient

func (*SFTPClient) Close added in v0.6.5

func (sf *SFTPClient) Close()

func (*SFTPClient) Get added in v0.6.5

func (sf *SFTPClient) Get(localPath, remotePath string, bar *pb.ProgressBar) error

Get transfer file/directory from remote server

func (*SFTPClient) Put added in v0.6.5

func (sf *SFTPClient) Put(localPath, remotePath string, bar *pb.ProgressBar) error

Put transfer file/directory to remote server

func (*SFTPClient) RemotePathSize added in v0.6.5

func (sf *SFTPClient) RemotePathSize(remotePath string) (int64, error)

RemotePathSize remote path size with all file in it

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

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, fileTransBuf int) *SSHRunner

func (*SSHRunner) ConcurrentExec added in v0.4.0

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

ConcurrentExec execute command sync

func (*SSHRunner) ConcurrentGet added in v0.6.5

func (sr *SSHRunner) ConcurrentGet(input runner.RcpInput, outputChan chan *runner.ConcurrentRcpOutput, limitChan chan int, pool *pb.Pool)

ConcurrentGet copy file to remote server concurrency

func (*SSHRunner) ConcurrentPut added in v0.6.5

func (sr *SSHRunner) ConcurrentPut(input runner.RcpInput, outputChan chan *runner.ConcurrentRcpOutput, limitChan chan int, pool *pb.Pool)

ConcurrentPut copy file from remote server concurrency

func (*SSHRunner) Login added in v0.5.0

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

Login login to remote server

func (*SSHRunner) RemotePathSize added in v0.6.5

func (sr *SSHRunner) RemotePathSize(input runner.RcpInput) (int64, error)

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