exec

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exec

type Exec struct {
	Command   []string
	Dir       string
	Stdin     []byte
	Env       []util.StringVar
	Timeout   time.Duration
	TeeStdout bool
	TeeStderr bool
}

func New

func New(command []string, dir string, stdin []byte, env []util.StringVar, opts ...Option) (*Exec, error)

func (*Exec) Run

func (e *Exec) Run() *ExecResult

type ExecResult

type ExecResult struct {
	Stdout    []byte
	Stderr    []byte
	Status    int
	Signal    os.Signal
	IsTimeout bool
	Err       error
}

type Option

type Option interface {
	Apply(e *Exec) error
}

func WithTeeStderr added in v0.4.0

func WithTeeStderr(t bool) Option

func WithTeeStdout added in v0.4.0

func WithTeeStdout(t bool) Option

func WithTimeout

func WithTimeout(t time.Duration) Option

type OptionTeeStderr added in v0.4.0

type OptionTeeStderr bool

func (OptionTeeStderr) Apply added in v0.4.0

func (t OptionTeeStderr) Apply(e *Exec) error

type OptionTeeStdout added in v0.4.0

type OptionTeeStdout bool

func (OptionTeeStdout) Apply added in v0.4.0

func (t OptionTeeStdout) Apply(e *Exec) error

type OptionTimeout

type OptionTimeout time.Duration

func (OptionTimeout) Apply

func (t OptionTimeout) Apply(e *Exec) error

Jump to

Keyboard shortcuts

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