Back to godoc.org

Package executor

v0.0.0-...-1557bcf
Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module: github.com/luci/luci-go

Overview

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

Index

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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier