Documentation
¶
Index ¶
- func Bkgd() func(*command)
- func Cancel(stop <-chan struct{}) func(*command)
- type Option
- type Output
- type Result
- func (r *Result) Canceled() bool
- func (r *Result) CrashReason() string
- func (r *Result) Crashed() bool
- func (r *Result) Duration() float64
- func (r *Result) Err() error
- func (r *Result) ExitCode() int
- func (r *Result) IsError() bool
- func (r *Result) IsReady() bool
- func (r *Result) PID() int
- func (r *Result) Ready() <-chan struct{}
- func (r *Result) Stderr() *Output
- func (r *Result) Stdout() *Output
- func (r *Result) TimedOut() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(s *command)
Option is a function that modifies the given shell command
func Context ¶
Context is an Option to set a context on the command that will interrupt the command if the context is done. Only the last call to this function will be taken into account.
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
Output is a structure to wrap the shell command output stream
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result is the wrapper
func Run ¶
Run executes the command and returns a Result object. The command can be configured via one or more Option functions.
func (*Result) CrashReason ¶
CrashReason returns the cause of the crash, or empty string if there was no crash
func (*Result) IsError ¶
IsError indicates if any error occured in preparing or executing the shell command. This will return false if the command ran ok, but just had a non-zero exit code.
func (*Result) IsReady ¶
IsReady returns a bool indicating if the command is done, and the Result object useable
func (*Result) Ready ¶
func (r *Result) Ready() <-chan struct{}
Ready returns a channel to indicate if the command is done
func (*Result) Stderr ¶
Stderr returns an Output object wrapping the latest lines from the stderr stream