Documentation
¶
Overview ¶
Package run provides a wrapper around os/exec with method chaining for modifying behaviour.
Index ¶
- Variables
- type RunInfo
- func (r *RunInfo) CombinedOutput() ([]byte, error)
- func (r *RunInfo) Ctx(ctx context.Context) *RunInfo
- func (r *RunInfo) Dir(dir string) *RunInfo
- func (r *RunInfo) Env(env ...string) *RunInfo
- func (r *RunInfo) In(input []byte) *RunInfo
- func (r *RunInfo) Log() *RunInfo
- func (r *RunInfo) Run() error
- func (r *RunInfo) STDOutOutput() ([]byte, error)
- func (r *RunInfo) Stdin() *RunInfo
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type RunInfo ¶
type RunInfo struct {
// contains filtered or unexported fields
}
func (*RunInfo) CombinedOutput ¶
CombinedOutput - Runs given CMD and returns STDOut and STDErr combined.
func (*RunInfo) Ctx ¶ added in v0.5.0
Ctx - specifies the context of the command to allow for timeouts.
func (*RunInfo) Run ¶
Run - wrapper around os/exec CMD.Run()
Run starts the specified command and waits for it to complete.
The returned error is nil if the command runs, has no problems copying stdin, stdout, and stderr, and exits with a zero exit status.
If the command starts but does not complete successfully, the error is of type *ExitError. Other error types may be returned for other situations.
func (*RunInfo) STDOutOutput ¶
STDOutOutput - Runs given CMD and returns STDOut only.