runner

package
Version: v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateID

func GenerateID() string

GenerateID creates a new ID.

func Register

func Register(name string, fn func(ctx Context, payload map[string]interface{}) (Runner, error))

Register registers a runner constructor.

Types

type Context

type Context interface {
	Name() string
	Environment() map[string]string
	ExpandAll(string) string
	ExpandVariables(string) string
	Workdir() string
	LogsFile() io.WriteSyncer
}

A Context carries the context of a Runner.

type Runner

type Runner interface {
	Run()
	Error() error
	IsErrorIgnored() bool
	AttachLogger(l logger.Logger)
}

A Runner is the action to be executed.

func Chain

func Chain(runners ...Runner) Runner

Chain wraps and runs sequentially the given runners.

func Lookup

func Lookup(ctx Context, payload map[string]interface{}) (Runner, error)

Lookup returns a new runner according given payload.

Jump to

Keyboard shortcuts

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