Versions in this module Expand all Collapse all v1 v1.0.1 Sep 12, 2024 v1.0.0 Jan 28, 2024 Changes in this version + var ErrPropSSHCommand = errorx.RegisterPrintableProperty("ssh_command") + var ErrPropSSHStderr = errorx.RegisterPrintableProperty("ssh_stderr") + var ErrPropSSHStdout = errorx.RegisterPrintableProperty("ssh_stdout") + var ErrSSHExecuteFailed = errNSSSH.NewType("execute_failed") + var ErrSSHExecuteTimedout = errNSSSH.NewType("execute_timedout") + func FindSSHAuthorizedKeysFile(ctx context.Context, exec ctxt.Executor) string + func NewSSH_Key(user, privateKeyPath, host string, port int) (*ssh.Client, error) + func NewSftpClient(sshClient *ssh.Client) (*sftp.Client, error) + func NewSshByPwd(user, password, host string, port int) (*ssh.Client, error) + func NewSshSession(sshClient *ssh.Client) (*ssh.Session, error) + func UploadFile(ip string, localFilePath string, remoteDir string, sftpClient *sftp.Client) error + type EasySSHExecutor struct + Config *easyssh.MakeConfig + Locale string + Sudo bool + func New(sudo bool, c SSHConfig) (*EasySSHExecutor, error) + func (e *EasySSHExecutor) Execute(ctx context.Context, cmd string, sudo bool, timeout ...time.Duration) ([]byte, []byte, error) + func (e *EasySSHExecutor) Transfer(ctx context.Context, src, dst string, download bool, limit int, compress bool) error + type SSHConfig struct + ExeTimeout time.Duration + Host string + KeyFile string + Passphrase string + Password string + Port int + Proxy *SSHConfig + Timeout time.Duration + User string + type SSHType int32 + const SSH_KEY + const SSH_PW + const SSH_UNKNOW