Documentation ¶
Overview ¶
Package sshcmd allows running commands on a remote host via ssh.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { SshClient *ssh.Client SftClient *sftp.Client Username string Host string Port string // contains filtered or unexported fields }
Client is a wrapped around ssh.Client to run commands on a remote host via ssh using a simple and easy to use APIs.
func MakeClient ¶
MakeClient returns an initialized Client.
func (*Client) Connect ¶
Connect connects the client to the remote host. After connection, the client is ready to run a command on the remote host.
func (*Client) ConnectSftpClient ¶ added in v0.1.0
ConnectSftpClient initialize and connects the sftp.Client using the current ssh.Client. If the sftpClient is already initialized, it has no effect.
type WalkDirFunc ¶ added in v0.1.0
WalkDirFunc is the type of the function called by WalkDir to visit each file or directory.
srcPath is the local source path.
dstPath is the remote destination path rooted in dstDir parameter of WalkDir method.
info and err are the same as fs.WalkDirFunc.