Documentation ¶
Index ¶
- type AuthConfig
- type ExecInfo
- type SSHClient
- func (c *SSHClient) Close()
- func (s *SSHClient) ConnectTest() bool
- func (s *SSHClient) DirFileExist(path string) bool
- func (s *SSHClient) Download(dstPath string, localPath string) (*TransferInfo, error)
- func (s *SSHClient) Exec(cmd string) (*ExecInfo, error)
- func (s *SSHClient) IsConnect() bool
- func (s *SSHClient) Ls(path string) ([]string, error)
- func (s *SSHClient) Mkdir(dir string) (*ExecInfo, error)
- func (s *SSHClient) NewSession() (*ssh.Session, error)
- func (s *SSHClient) RM(file string, dir bool) (*ExecInfo, error)
- func (s *SSHClient) Reconnect() error
- func (s *SSHClient) Test()
- func (s *SSHClient) Upload(localPath string, dstPath string) error
- type TransferInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type ExecInfo ¶
func (*ExecInfo) OutputString ¶
type SSHClient ¶
type SSHClient struct { HostName string Port int Password string // contains filtered or unexported fields }
SSHClient结构体
func NewSSHClient ¶
func NewSSHClient(host string, port int, authConfig AuthConfig) (*SSHClient, error)
func (*SSHClient) ConnectTest ¶
func (*SSHClient) DirFileExist ¶
DirFileExist 判断目录或文件是否存在
func (*SSHClient) Download ¶
func (s *SSHClient) Download(dstPath string, localPath string) (*TransferInfo, error)
从远程主机上下载文件到本地
type TransferInfo ¶
type TransferInfo struct { Kind string // upload或download Local string // 本地路径 Dst string // 目标路径 TransferByte int64 // 传输的字节数(byte) }
func (*TransferInfo) String ¶
func (t *TransferInfo) String() string
Click to show internal directories.
Click to hide internal directories.