cmdrunner

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Env

func Env(key, val string) string

Env returns a new env var value from key and val.

Types

type Executor

type Executor interface {
	Wait() error
	Start() error
	Signal(os.Signal)
	Write(data []byte) (n int, err error)
}

Executor represents a command to execute

type Option

type Option func(*Runner)

Option defines option to run commands

func DefaultStderr

func DefaultStderr(writer io.Writer) Option

DefaultStderr provides the default stderr for the commands to run

func DefaultStdin

func DefaultStdin(reader io.Reader) Option

DefaultStdin provides the default stdin for the commands to run

func DefaultStdout

func DefaultStdout(writer io.Writer) Option

DefaultStdout provides the default stdout for the commands to run

func DefaultWorkdir

func DefaultWorkdir(path string) Option

DefaultWorkdir provides the default working directory for the commands to run

func EndSignal

func EndSignal(s os.Signal) Option

EndSignal configures s to be signaled to the processes to end them.

func RunParallel

func RunParallel() Option

RunParallel allows the commands to run concurrently

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner is an object to run commands

func New

func New(options ...Option) *Runner

New returns a new commands runner

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, steps ...*step.Step) error

Run blocks until all steps have completed their executions.

Directories

Path Synopsis
Package exec provides easy access to command execution for basic uses.
Package exec provides easy access to command execution for basic uses.

Jump to

Keyboard shortcuts

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