Package executor contains an implementation of the Annotee Executor. The Executor bootstraps an application and passes its output through a Processor instance.



This section is empty.


This section is empty.


This section is empty.


type Executor

type Executor struct {
	// Options are the set of Annotee options to use.
	Options annotee.Options

	// Stdin, if not nil, will be used as standard input for the bootstrapped
	// process.
	Stdin io.Reader

	// TeeStdout, if not nil, is a Writer where bootstrapped process standard
	// output will be tee'd.
	TeeStdout io.Writer
	// TeeStderr, if not nil, is a Writer where bootstrapped process standard
	// error will be tee'd.
	TeeStderr io.Writer
	// contains filtered or unexported fields

Executor bootstraps an application, running its output through a Processor.

func (*Executor) Executed

func (e *Executor) Executed() bool

Executed returns true if the bootstrapped process' execution completed successfully. This is independent of the return value, and can be used to differentiate execution errors from process errors.

func (*Executor) ReturnCode

func (e *Executor) ReturnCode() int

ReturnCode returns the executed process' return code.

If the process hasn't completed its execution (see Executed), then this will return 0.

func (*Executor) Run

func (e *Executor) Run(ctx context.Context, command []string) error

Run executes the bootstrapped process, blocking until it completes.

func (*Executor) Step

func (e *Executor) Step() []byte

Step returns the root Step protobuf from the latest run.

Source Files