executor

package
v0.0.0-...-9c33426 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	Execute(output io.Writer, workingDir string, name string, args ...string) error
	ExecuteAndCapture(output io.Writer, workingDir string, name string, args ...string) (string, error)
	SetVerbose(bool)
}

type FakeExecutor

type FakeExecutor struct {
	Handler          func(workingDir string, name string, args ...string) error
	ReturningHandler func(workingDir string, name string, args ...string) (string, error)
	// contains filtered or unexported fields
}

func NewAlwaysFailsFakeExecutor

func NewAlwaysFailsFakeExecutor() *FakeExecutor

func NewAlwaysSucceedsFakeExecutor

func NewAlwaysSucceedsFakeExecutor() *FakeExecutor

func NewFakeExecutor

func NewFakeExecutor(handler func(string, string, ...string) error, returningHandler func(string, string, ...string) (string, error)) *FakeExecutor

func (*FakeExecutor) AssertCalledWith

func (e *FakeExecutor) AssertCalledWith(t *testing.T, expected [][]string)

func (*FakeExecutor) Execute

func (e *FakeExecutor) Execute(_ io.Writer, workingDir string, name string, args ...string) error

func (*FakeExecutor) ExecuteAndCapture

func (e *FakeExecutor) ExecuteAndCapture(_ io.Writer, workingDir string, name string, args ...string) (string, error)

func (*FakeExecutor) SetVerbose

func (e *FakeExecutor) SetVerbose(_ bool)

type RealExecutor

type RealExecutor struct {
	Verbose bool
}

func NewRealExecutor

func NewRealExecutor() *RealExecutor

func (*RealExecutor) Execute

func (e *RealExecutor) Execute(output io.Writer, workingDir string, name string, args ...string) error

func (*RealExecutor) ExecuteAndCapture

func (e *RealExecutor) ExecuteAndCapture(output io.Writer, workingDir string, name string, args ...string) (string, error)

func (*RealExecutor) SetVerbose

func (e *RealExecutor) SetVerbose(verbose bool)

Jump to

Keyboard shortcuts

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