Documentation
¶
Index ¶
- type Executor
- func (e *Executor) AddOutputFilter(substring string) *Executor
- func (e *Executor) Capture() *Result
- func (e *Executor) CaptureAndTrim() *Result
- func (e *Executor) Run() *Result
- func (e *Executor) SetCwd(cwd string) *Executor
- func (e *Executor) SetEnv(env []string) *Executor
- func (e *Executor) SetEnvVar(name, value string) *Executor
- func (e *Executor) SetOutputPrefix(prefix string) *Executor
- type Result
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 struct {
// contains filtered or unexported fields
}
Executor prepares and run a command execution
func NewShell ¶ added in v0.1.0
NewShell returns an *Executor that will run the command line in a shell
func (*Executor) AddOutputFilter ¶ added in v0.3.0
AddOutputFilter adds a substring to the list used to suppress lines printed by the command
func (*Executor) CaptureAndTrim ¶ added in v0.2.0
CaptureAndTrim calls Capture() and trim the blank lines
func (*Executor) SetCwd ¶ added in v0.1.0
SetCwd changes the current working directory the command will be run in
func (*Executor) SetEnv ¶ added in v0.2.0
SetEnv changes the environment variables that will be used to run the command
func (*Executor) SetEnvVar ¶ added in v0.7.0
SetEnvVar sets a single variable in the environment that will be used to run the command
func (*Executor) SetOutputPrefix ¶ added in v0.3.0
SetOutputPrefix sets a prefix for each line printed by the command
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
Click to show internal directories.
Click to hide internal directories.