Documentation
¶
Overview ¶
Package execute tries it's best to run complex, sometimes multiline bash commands.
Index ¶
- Variables
- func Command(cmdString string, stdOut io.Writer, stdErr io.Writer, envs map[string]string) (int, error)
- func CommandNoWait(cmdString string, stdOut io.Writer, stdErr io.Writer, envs map[string]string) (*exec.Cmd, error)
- func GetExitStatus(waitError error) int
- func WaitNoop(interrupt chan os.Signal, cmd *exec.Cmd)
- type SSH
- type SSHConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Debug prints the command being run if set to true. Debug = false )
Functions ¶
func Command ¶
func Command(cmdString string, stdOut io.Writer, stdErr io.Writer, envs map[string]string) (int, error)
Command just executes a given cmd string to the supplied io.Writer writers. If optional envs is passed in then the expanded values will be used vs the os versions.
func CommandNoWait ¶
func CommandNoWait(cmdString string, stdOut io.Writer, stdErr io.Writer, envs map[string]string) (*exec.Cmd, error)
CommandNoWait starts the given command but does not wait for it to finish. It returns the created exec.Command which can be used with Wait.
func GetExitStatus ¶ added in v1.1.0
GetExitStatus determines the exit status code of an err from a command that was run.
Types ¶
type SSH ¶ added in v1.1.0
SSH holds the ssh configuration and io.
type SSHConfig ¶ added in v1.1.0
type SSHConfig struct { Host string `json:"host" yaml:"host"` Port int `json:"port" yaml:"port"` User string `json:"user" yaml:"user"` ProxyHost string `json:"proxy_host,omitempty" yaml:"proxy_host,omitempty"` ProxyPort int `json:"proxy_port,omitempty" yaml:"proxy_port,omitempty"` ProxyUser string `json:"proxy_user,omitempty" yaml:"proxy_user,omitempty"` IdentityFile string `json:"identity_file,omitempty" yaml:"identity_file,omitempty"` }
SSHConfig is an individual ssh configuration for creating a connection.
Click to show internal directories.
Click to hide internal directories.