cmdrunner

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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