runner

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrChildSpawn = errors.New("cannot re-spawn a child process")
)

Helper errors

Functions

This section is empty.

Types

type Option

type Option func(*Runner) error

Option is a functional option for extractors.

func WithAllEnabled added in v0.4.0

func WithAllEnabled(all bool) Option

func WithExecutable

func WithExecutable(path string, args ...string) Option

func WithKubeFactory

func WithKubeFactory(factory cmdutil.Factory) Option

func WithKubeNamespace

func WithKubeNamespace(namespace string) Option

func WithLogger

func WithLogger(l *logger.Logger) Option

func WithLoop

func WithLoop(loop bool) Option

func WithPlugin added in v0.4.0

func WithPlugin(plugin Plugin) Option

func WithQuiet added in v0.5.0

func WithQuiet(quiet bool) Option

func WithSleep

func WithSleep(d time.Duration) Option

type Options

type Options []Option

Options is a slice of Option.

func (Options) Apply

func (o Options) Apply(runner *Runner) error

Apply interates over Options and calls each functional option with a given runner.

type Plugin added in v0.4.0

type Plugin interface {
	PreRun(ctx context.Context, log *logger.Entry, n string, f events.Action) error
	PostRun(ctx context.Context, log *logger.Entry, n string, f events.Action, err error) error
}

type Runner

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

func New

func New(options ...Option) (*Runner, error)

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, m map[string]events.Action) (err error)

Jump to

Keyboard shortcuts

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