Documentation ¶
Overview ¶
Package remote provides the command execution functions on the remote host.
Index ¶
- Variables
- func CopyFilesFromRemoteBySSH(remoteHost, localDirOrFile string, remoteFiles ...string) error
- func CopyFilesFromRemoteBySSHContext(ctx context.Context, remoteHost, localDirOrFile string, remoteFiles ...string) error
- func CopyFilesToRemoteBySSH(remoteHost, remoteDirOrFile string, localFiles ...string) error
- func CopyFilesToRemoteBySSHContext(ctx context.Context, remoteHost, remoteDirOrFile string, localFiles ...string) error
- func ExecuteCmdBySSH(remoteHost, cmd string) (stdout, stderr string, err error)
- func ExecuteCmdBySSHContext(ctx context.Context, remoteHost, cmd string) (stdout, stderr string, err error)
- func ExecuteScriptBySSH(remoteHost, script string) (stdout, stderr string, err error)
- func ExecuteScriptBySSHContext(ctx context.Context, remoteHost, script string) (stdout, stderr string, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var SSHOptions = "-o StrictHostKeyChecking=no"
SSHOptions is the options of ssh/scp command.
View Source
var SSHUser = "root"
SSHUser is the user to execute the shell command by SSH.
Functions ¶
func CopyFilesFromRemoteBySSH ¶
CopyFilesFromRemoteBySSH is equal to
CopyFilesFromRemoteBySSHContext(context.Background(), remoteHost, localDirOrFile, remoteFiles...)
func CopyFilesFromRemoteBySSHContext ¶
func CopyFilesFromRemoteBySSHContext(ctx context.Context, remoteHost, localDirOrFile string, remoteFiles ...string) error
CopyFilesFromRemoteBySSHContext copies the files from the remote to the local.
func CopyFilesToRemoteBySSH ¶
CopyFilesToRemoteBySSH is equal to
CopyFilesToRemoteBySSHContext(context.Background(), remoteHost, remoteDirOrFile, localFiles...)
func CopyFilesToRemoteBySSHContext ¶
func CopyFilesToRemoteBySSHContext(ctx context.Context, remoteHost, remoteDirOrFile string, localFiles ...string) error
CopyFilesToRemoteBySSHContext copies the files from the local to the remote.
func ExecuteCmdBySSH ¶
ExecuteCmdBySSH is equal to
ExecuteCmdBySSHContext(context.Background(), remoteHost, cmd)
func ExecuteCmdBySSHContext ¶
func ExecuteCmdBySSHContext(ctx context.Context, remoteHost, cmd string) ( stdout, stderr string, err error)
ExecuteCmdBySSHContext executes the command on the remote host by SSH.
func ExecuteScriptBySSH ¶
ExecuteScriptBySSH is equal to
ExecuteScriptBySSHContext(context.Background(), remoteHost, script)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.