Documentation
¶
Index ¶
- Variables
- type CommandListener
- type CommandResult
- type CommandRunner
- func (r *CommandRunner) Arg(arg string) *CommandRunner
- func (r *CommandRunner) Args(arg []string) *CommandRunner
- func (r *CommandRunner) EnsureExitcode(arg ...int) *CommandRunner
- func (r *CommandRunner) Env(key, value string) *CommandRunner
- func (r *CommandRunner) Envs(env []string) *CommandRunner
- func (r *CommandRunner) FailOnExitCode() *CommandRunner
- func (r *CommandRunner) FailOnStderr() *CommandRunner
- func (r *CommandRunner) FailOnTimeout() *CommandRunner
- func (r *CommandRunner) Listen(lstr CommandListener) *CommandRunner
- func (r *CommandRunner) ListenStderr(lstr func(string)) *CommandRunner
- func (r *CommandRunner) ListenStdout(lstr func(string)) *CommandRunner
- func (r *CommandRunner) RawEnv(env string) *CommandRunner
- func (r *CommandRunner) Run() (CommandResult, error)
- func (r *CommandRunner) Timeout(timeout time.Duration) *CommandRunner
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrExitCode = errors.New("process exited with an unexpected exitcode")
View Source
var ErrStderrPrint = errors.New("process did print to stderr stream")
View Source
var ErrTimeout = errors.New("process did not exit after the specified timeout")
Functions ¶
This section is empty.
Types ¶
type CommandListener ¶
type CommandResult ¶
type CommandResult struct {
StdOut string
StdErr string
StdCombined string
ExitCode int
CommandTimedOut bool
}
func RunCommand ¶
type CommandRunner ¶
type CommandRunner struct {
// contains filtered or unexported fields
}
func Runner ¶
func Runner(program string) *CommandRunner
func (*CommandRunner) Arg ¶
func (r *CommandRunner) Arg(arg string) *CommandRunner
func (*CommandRunner) Args ¶
func (r *CommandRunner) Args(arg []string) *CommandRunner
func (*CommandRunner) EnsureExitcode ¶
func (r *CommandRunner) EnsureExitcode(arg ...int) *CommandRunner
func (*CommandRunner) Env ¶
func (r *CommandRunner) Env(key, value string) *CommandRunner
func (*CommandRunner) Envs ¶
func (r *CommandRunner) Envs(env []string) *CommandRunner
func (*CommandRunner) FailOnExitCode ¶
func (r *CommandRunner) FailOnExitCode() *CommandRunner
func (*CommandRunner) FailOnStderr ¶
func (r *CommandRunner) FailOnStderr() *CommandRunner
func (*CommandRunner) FailOnTimeout ¶
func (r *CommandRunner) FailOnTimeout() *CommandRunner
func (*CommandRunner) Listen ¶
func (r *CommandRunner) Listen(lstr CommandListener) *CommandRunner
func (*CommandRunner) ListenStderr ¶
func (r *CommandRunner) ListenStderr(lstr func(string)) *CommandRunner
func (*CommandRunner) ListenStdout ¶
func (r *CommandRunner) ListenStdout(lstr func(string)) *CommandRunner
func (*CommandRunner) RawEnv ¶
func (r *CommandRunner) RawEnv(env string) *CommandRunner
func (*CommandRunner) Run ¶
func (r *CommandRunner) Run() (CommandResult, error)
func (*CommandRunner) Timeout ¶
func (r *CommandRunner) Timeout(timeout time.Duration) *CommandRunner
Click to show internal directories.
Click to hide internal directories.