run

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2018 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOutputs

func GetOutputs(r Runner) (io.Reader, io.Reader, error)

GetOutputs is a helper method that returns both stdout and stderr outputs from the runner.

Types

type Runner

type Runner interface {
	// StdoutPipe returns a pipe that will be connected to the runner's
	// standard output when the command starts.
	StdoutPipe() (io.ReadCloser, error)

	// StderrPipe returns a pipe that will be connected to the runner's
	// standard error when the command starts.
	StderrPipe() (io.ReadCloser, error)

	// Start starts the runner but does not wait for it to complete.
	Start() error

	// Wait waits for the runner to exit. It must have been started by Start.
	//
	// The returned error is nil if the runner has no problems copying
	// stdin, stdout, and stderr, and exits with a zero exit status.
	Wait() error
}

Runner just runs anything.

func NewBashRunner

func NewBashRunner(code string, workdir string, env []string) (Runner, error)

NewBashRunner creates a Bash runner.

func NewShRunner

func NewShRunner(code string, workdir string, env []string) (Runner, error)

NewShRunner creates a system standard shell script runner.

Jump to

Keyboard shortcuts

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