Documentation ¶
Index ¶
- Variables
- type Command
- func (c *Command) AppendEnv(env []string)
- func (c *Command) GetExitCode() int
- func (c *Command) GetStderr() io.Writer
- func (c *Command) GetStdout() io.Writer
- func (c *Command) RunExecutable(executable string, params ...string) error
- func (c *Command) RunExecutableInBackground(executable string, params ...string) (Execution, error)
- func (c *Command) RunShell(shell, script string) error
- func (c *Command) SetDir(dir string)
- func (c *Command) SetEnv(env []string)
- func (c *Command) Stderr(stderr io.Writer)
- func (c *Command) Stdin(stdin io.Reader)
- func (c *Command) Stdout(stdout io.Writer)
- type ExecRunner
- type Execution
- type ShellRunner
Constants ¶
This section is empty.
Variables ¶
var ExecCommand = exec.Command
ExecCommand defines how to execute os commands
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { ErrorCategoryMapping map[string][]string // contains filtered or unexported fields }
Command defines the information required for executing a call to any executable
func (*Command) AppendEnv ¶ added in v1.62.0
AppendEnv appends environment variables to be used for execution
func (*Command) GetExitCode ¶ added in v1.51.0
GetExitCode allows to retrieve the exit code of a command execution
func (*Command) RunExecutable ¶
RunExecutable runs the specified executable with parameters !! While the cmd.Env is applied during command execution, it is NOT involved when the actual executable is resolved.
Thus the executable needs to be on the PATH of the current process and it is not sufficient to alter the PATH on cmd.Env.
func (*Command) RunExecutableInBackground ¶ added in v1.45.0
RunExecutableInBackground runs the specified executable with parameters in the background non blocking !! While the cmd.Env is applied during command execution, it is NOT involved when the actual executable is resolved.
Thus the executable needs to be on the PATH of the current process and it is not sufficient to alter the PATH on cmd.Env.
type ExecRunner ¶ added in v1.51.0
type ExecRunner interface { RunExecutable(executable string, params ...string) error RunExecutableInBackground(executable string, params ...string) (Execution, error) // contains filtered or unexported methods }
ExecRunner mock for intercepting calls to executables
type Execution ¶ added in v1.45.0
Execution references a background process which is started by RunExecutableInBackground
type ShellRunner ¶ added in v1.51.0
type ShellRunner interface { RunShell(shell string, command string) error // contains filtered or unexported methods }
ShellRunner mock for intercepting shell calls