exec

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyCommand is returned when no commands are supplied.
	ErrEmptyCommand = fmt.Errorf("no command given")
)

Functions

func Pipe

func Pipe(cmds [][]string, options ...Option) error

Pipe executes the given commands piping the output from the previous command as the input to the next.

func PipeContext

func PipeContext(ctx context.Context, cmds [][]string, options ...Option) error

PipeContext executes the given commands piping the output from the previous command as the input to the next.

func Run

func Run(cmd []string, options ...Option) error

Run runs the command using the supplied options.

func RunContext

func RunContext(ctx context.Context, cmd []string, options ...Option) error

RunContext runs the command using the given context and supplied options.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func Err

func Err(w io.Writer) Option

func In

func In(r io.Reader) Option

func Out

func Out(w io.Writer) Option

type Options

type Options struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

Options defines in/out/err streams for commands.

Jump to

Keyboard shortcuts

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