executor

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor added in v0.1.0

type Executor interface {
	SetCwd(cwd string) Executor
	SetEnv(env []string) Executor
	SetEnvVar(name, value string) Executor
	SetOutputPrefix(prefix string) Executor
	SetPTY(enabled bool) Executor
	AddOutputFilter(substring string) Executor
	Run() *Result
	Capture() *Result
	CaptureAndTrim() *Result
}

Executor prepares and run a command execution

func New added in v0.1.0

func New(program string, args ...string) Executor

New returns an Executor that will run the program with arguments

func NewShell added in v0.1.0

func NewShell(cmdline string) Executor

NewShell returns an Executor that will run the command line in a shell

type Result added in v0.8.0

type Result struct {
	Code        int    // code returned by the process
	Error       error  // error about the process launch and exit
	LaunchError error  // error about the process launch
	Output      string // command output if captured, otherwise empty
}

Result represents the result of a command execution

Jump to

Keyboard shortcuts

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