Documentation ¶
Index ¶
- Constants
- func Copy(size int64, mode os.FileMode, fileName string, contents io.Reader, ...) error
- func CopyPath(filePath string, destinationPath string, session *ssh.Session) error
- type BaseCommand
- type Command
- type Local
- func (me *Local) GetIP() string
- func (me *Local) GetURL() string
- func (me *Local) RunCommand(cmd string) (string, error)
- func (me *Local) RunCommands(cmds ...string) ([]string, error)
- func (me *Local) RunShell(filePath string, remotePath string, params ...string) (outputs []string, err error)
- func (me *Local) RunTransaction(do func(tx BaseCommand) error) error
- func (me *Local) SendDir(localDir, remoteDir string) error
- func (me *Local) SendFile(localPath string, remotePath string) error
- type Path
- type SSHClient
- func (me *SSHClient) GetIP() string
- func (me *SSHClient) GetURL() string
- func (me *SSHClient) RunCommand(cmd string) (string, error)
- func (me *SSHClient) RunCommands(cmds ...string) ([]string, error)
- func (me *SSHClient) RunShell(filePath string, remotePath string, params ...string) (outputs []string, err error)
- func (me *SSHClient) RunTransaction(do func(ctx TransactionContext) error) error
- func (me *SSHClient) SendDir(localDir string, remoteDir string) error
- func (me *SSHClient) SendFile(localPath string, remotePath string) error
- type TransactionContext
- func (me *TransactionContext) RunCommand(cmd string) (string, error)
- func (me *TransactionContext) RunCommands(cmds ...string) ([]string, error)
- func (me *TransactionContext) RunShell(filePath string, remotePath string, params ...string) (outputs []string, err error)
- func (me *TransactionContext) SendDir(localDir, remoteDir string) error
- func (me *TransactionContext) SendFile(localPath string, remotePath string) error
Constants ¶
View Source
const ( CertPassword sshMode = iota CertPublicKeyFile DefaultTimeout = 60 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseCommand ¶
type BaseCommand interface { RunCommand(cmd string) (string, error) RunCommands(cmds ...string) ([]string, error) RunShell(filePath string, remotePath string, params ...string) (outputs []string, err error) SendFile(localPath string, remotePath string) error SendDir(localDir, remoteDir string) error }
type Command ¶
type Command interface { BaseCommand GetURL() string GetIP() string RunTransaction(do func(tx BaseCommand) error) error }
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
func (*Local) RunShell ¶
func (me *Local) RunShell(filePath string, remotePath string, params ...string) (outputs []string, err error)
不实现
func (*Local) RunTransaction ¶
func (me *Local) RunTransaction(do func(tx BaseCommand) error) error
不实现
type SSHClient ¶
func (*SSHClient) RunTransaction ¶
func (me *SSHClient) RunTransaction(do func(ctx TransactionContext) error) error
type TransactionContext ¶
type TransactionContext struct {
// contains filtered or unexported fields
}
func (*TransactionContext) RunCommand ¶
func (me *TransactionContext) RunCommand(cmd string) (string, error)
func (*TransactionContext) RunCommands ¶
func (me *TransactionContext) RunCommands(cmds ...string) ([]string, error)
func (*TransactionContext) SendDir ¶
func (me *TransactionContext) SendDir(localDir, remoteDir string) error
Click to show internal directories.
Click to hide internal directories.