executor

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: MIT Imports: 8 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 struct {
	// contains filtered or unexported fields
}

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

func (*Executor) AddOutputFilter added in v0.3.0

func (e *Executor) AddOutputFilter(substring string) *Executor

AddOutputFilter adds a substring to the list used to suppress lines printed by the command

func (*Executor) Capture added in v0.1.0

func (e *Executor) Capture() (string, error)

Capture executes the command and return the output and the exit code

func (*Executor) CaptureAndTrim added in v0.2.0

func (e *Executor) CaptureAndTrim() (string, error)

CaptureAndTrim calls Capture() and trim the blank lines

func (*Executor) Run added in v0.1.0

func (e *Executor) Run() error

Run executes the command. Return an error for non-zero exitcode.

func (*Executor) RunWithCode added in v0.3.0

func (e *Executor) RunWithCode() (int, error)

RunWithCode executes the command. Return the exit code and an error.

func (*Executor) SetCwd added in v0.1.0

func (e *Executor) SetCwd(cwd string) *Executor

SetCwd changes the current working directory the command will be run in

func (*Executor) SetEnv added in v0.2.0

func (e *Executor) SetEnv(env []string) *Executor

SetEnv changes the environment variables that will be used to run the command

func (*Executor) SetOutputPrefix added in v0.3.0

func (e *Executor) SetOutputPrefix(prefix string) *Executor

SetOutputPrefix sets a prefix for each line printed by the command

Jump to

Keyboard shortcuts

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