cmdrunner

package
v28.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 10 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 EnableDebug

func EnableDebug() Option

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 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 command 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