cmdext

package
v0.0.340 Latest Latest
Warning

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

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

Documentation

Index

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 added in v0.0.72

type CommandListener interface {
	ReadRawStdout([]byte)
	ReadRawStderr([]byte)

	ReadStdoutLine(string)
	ReadStderrLine(string)

	Finished(int)
	Timeout()
}

type CommandResult

type CommandResult struct {
	StdOut          string
	StdErr          string
	StdCombined     string
	ExitCode        int
	CommandTimedOut bool
}

func RunCommand

func RunCommand(program string, args []string, timeout *time.Duration) (CommandResult, error)

type CommandRunner added in v0.0.68

type CommandRunner struct {
	// contains filtered or unexported fields
}

func Runner added in v0.0.68

func Runner(program string) *CommandRunner

func (*CommandRunner) Arg added in v0.0.68

func (r *CommandRunner) Arg(arg string) *CommandRunner

func (*CommandRunner) Args added in v0.0.68

func (r *CommandRunner) Args(arg []string) *CommandRunner

func (*CommandRunner) EnsureExitcode added in v0.0.84

func (r *CommandRunner) EnsureExitcode(arg ...int) *CommandRunner

func (*CommandRunner) Env added in v0.0.68

func (r *CommandRunner) Env(key, value string) *CommandRunner

func (*CommandRunner) Envs added in v0.0.68

func (r *CommandRunner) Envs(env []string) *CommandRunner

func (*CommandRunner) FailOnExitCode added in v0.0.84

func (r *CommandRunner) FailOnExitCode() *CommandRunner

func (*CommandRunner) FailOnStderr added in v0.0.236

func (r *CommandRunner) FailOnStderr() *CommandRunner

func (*CommandRunner) FailOnTimeout added in v0.0.84

func (r *CommandRunner) FailOnTimeout() *CommandRunner

func (*CommandRunner) Listen added in v0.0.72

func (r *CommandRunner) Listen(lstr CommandListener) *CommandRunner

func (*CommandRunner) ListenStderr added in v0.0.72

func (r *CommandRunner) ListenStderr(lstr func(string)) *CommandRunner

func (*CommandRunner) ListenStdout added in v0.0.72

func (r *CommandRunner) ListenStdout(lstr func(string)) *CommandRunner

func (*CommandRunner) RawEnv added in v0.0.68

func (r *CommandRunner) RawEnv(env string) *CommandRunner

func (*CommandRunner) Run added in v0.0.68

func (r *CommandRunner) Run() (CommandResult, error)

func (*CommandRunner) Timeout added in v0.0.68

func (r *CommandRunner) Timeout(timeout time.Duration) *CommandRunner

Jump to

Keyboard shortcuts

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