exec

package
v0.0.0-...-8b6a423 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandExec

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

func (*CommandExec) Args

func (c *CommandExec) Args() []string

func (*CommandExec) Command

func (c *CommandExec) Command() string

func (*CommandExec) Err

func (c *CommandExec) Err() error

func (*CommandExec) ExitCode

func (c *CommandExec) ExitCode() int

func (*CommandExec) Stderr

func (c *CommandExec) Stderr() *bytes.Buffer

func (*CommandExec) Stdout

func (c *CommandExec) Stdout() *bytes.Buffer

type Execution

type Execution interface {
	Command() string
	Args() []string
	Stdout() *bytes.Buffer
	Stderr() *bytes.Buffer
	ExitCode() int
	Err() error
}

func Run

func Run(ctx context.Context, command string, stdin *string, args ...string) Execution

type ExecutionExitError

type ExecutionExitError = exec.ExitError

type Executor

type Executor = func(ctx context.Context, command string, stdin *string, args ...string) Execution

func NewTestExecutor

func NewTestExecutor(stdout string, stderr string, exitCode int, err error) Executor

type LoggingExecutor

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

func NewLoggingExecutor

func NewLoggingExecutor(delegate Executor, logger *zap.Logger) *LoggingExecutor

func (*LoggingExecutor) Run

func (lx *LoggingExecutor) Run(ctx context.Context, command string, stdin *string, args ...string) Execution

type PoolExecutor

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

func NewPoolExecutor

func NewPoolExecutor(delegate Executor) *PoolExecutor

func (*PoolExecutor) Run

func (px *PoolExecutor) Run(ctx context.Context, command string, stdin *string, args ...string) Execution

type TestExecution

type TestExecution struct {
	TestCommand  string
	TestArgs     []string
	TestStdin    string
	TestStdout   *bytes.Buffer
	TestStderr   *bytes.Buffer
	TestExitCode int
	TestErr      error
}

func (*TestExecution) Args

func (e *TestExecution) Args() []string

func (*TestExecution) Command

func (e *TestExecution) Command() string

func (*TestExecution) Err

func (e *TestExecution) Err() error

func (*TestExecution) ExitCode

func (e *TestExecution) ExitCode() int

func (*TestExecution) Stderr

func (e *TestExecution) Stderr() *bytes.Buffer

func (*TestExecution) Stdout

func (e *TestExecution) Stdout() *bytes.Buffer

type TimingExecutor

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

func NewTimingExecutor

func NewTimingExecutor(delegate Executor) *TimingExecutor

func (*TimingExecutor) Run

func (tx *TimingExecutor) Run(ctx context.Context, command string, stdin *string, args ...string) Execution

Jump to

Keyboard shortcuts

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