exec

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunDockerExecCommand

func RunDockerExecCommand(container, cmd, workdir string, envs map[string]string, stdin string) (
	code int, stdout string, stderr string, err error,
)

RunDockerExecCommand runs the provided command on the specified host using "docker exec". Returns the exit code of the command, along with the contents of stdout and stderr as strings. Note that if the command returns a non-zero error code, this function does not report it as an error.

func RunDockerPsFilterCommand

func RunDockerPsFilterCommand(filter string) (
	code int, stdout string, stderr string, err error,
)

RunDockerPsFilterCommand runs the provided command on the specified host using "docker ps filter". Returns the exit code of the command, along with the contents of stdout and stderr as strings.

func RunSSHCommand

func RunSSHCommand(host string, config *ssh.ClientConfig, cmd string, envs map[string]string, stdin string, sudo bool) (
	code int, stdout, stderr string, err error)

RunSSHCommand runs the provided SSH command on the specified host. Returns the exit code of the command, along with the contents of stdout and stderr as strings. Note that if the command returns a non-zero error code, this function does not report it as an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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