harness

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultCmd

func DefaultCmd() []string

func DefaultEntrypoint

func DefaultEntrypoint() []string

Types

type Command

type Command struct {
	Args       string
	WorkingDir string
	Env        map[string]string
	Stdout     io.Writer
	Stderr     io.Writer
}

type Harness

type Harness interface {
	Create(context.Context) error
	Destroy(context.Context) error
	Run(context.Context, Command) error
}

type RunError added in v0.0.34

type RunError struct {
	ExitCode int
	Cmd      string
	// CombinedOutput is intentional since when something goes wrong, it usually
	// makes more sense to see the interweaved stdout/stderr since thats how they
	// appear in a shell.
	CombinedOutput string
}

func (*RunError) Error added in v0.0.34

func (e *RunError) Error() string

type Stack

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

Stack is a lifo queue used to easily manage resources that need to be torn down by harnesses. It is a LIFO queue, so the first item added is the last item torn down.

func NewStack

func NewStack() *Stack

func (*Stack) Add

func (r *Stack) Add(f func(ctx context.Context) error) error

func (*Stack) Teardown

func (r *Stack) Teardown(ctx context.Context) error

Directories

Path Synopsis
Package pterraform provides a harness that runs arbitrary terraform on a given path.
Package pterraform provides a harness that runs arbitrary terraform on a given path.

Jump to

Keyboard shortcuts

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