runner

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExitError

type ExitError struct {
	CapturedError       error
	CapturedErrorOutput []byte
}

func (ExitError) Error

func (e ExitError) Error() string

func (ExitError) GetCode

func (e ExitError) GetCode() int

func (ExitError) Unwrap

func (e ExitError) Unwrap() error

type Options

type Options struct {
	// Whether to attach stdin configuration. assume false
	Interactive bool

	// Whether to attach stdout configuration. assume false aka hide output
	ShowOutput bool

	// Whether to attach stdout configuration. assume false aka show err output
	SuppressErrOutput bool
}

func (Options) WithInteractive

func (o Options) WithInteractive(interactive bool) Options

func (Options) WithShowOutput

func (o Options) WithShowOutput(showOutput bool) Options

func (Options) WithSuppressErrOutput

func (o Options) WithSuppressErrOutput(suppressErrOutput bool) Options

type Runnable

type Runnable interface {
	// Output runs and returns output.
	Output() ([]byte, error)

	// String provides a human readable version for debugging
	String() string
}

Runnable is something tha can run multiple times.

func AddEnvironment

func AddEnvironment(runner Runnable, prefix string, environment []model.ValuePair) Runnable

AddEnvironment add environment variables to a given Runnable. This will only do something if the runnable was built with NewCMDRunner.

func NewCMDRunner

func NewCMDRunner(dir, binary string, options Options, args ...string) Runnable

NewCMDRunner builds an exec.Cmd specific Runnable. on each run the exec.Cmd is copied so it can be ran again

Jump to

Keyboard shortcuts

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