remote

package
v0.39.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package remote provides the command execution functions on the remote host.

Index

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

func CopyFilesFromRemoteBySSH(remoteHost, localDirOrFile string, remoteFiles ...string) error

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

func CopyFilesToRemoteBySSH(remoteHost, remoteDirOrFile string, localFiles ...string) error

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

func ExecuteCmdBySSH(remoteHost, cmd string) (stdout, stderr string, err error)

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

func ExecuteScriptBySSH(remoteHost, script string) (stdout, stderr string, err error)

ExecuteScriptBySSH is equal to

ExecuteScriptBySSHContext(context.Background(), remoteHost, script)

func ExecuteScriptBySSHContext

func ExecuteScriptBySSHContext(ctx context.Context, remoteHost, script string) (
	stdout, stderr string, err error)

ExecuteScriptBySSHContext executes the shell script by SSH.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL