Documentation ¶
Index ¶
- Constants
- func CartesianProduct(mapOfLists map[string][]interface{}) []map[string]interface{}
- func CopyDir(source string, dest string) (err error)
- func CopyFile(source string, dest string) (err error)
- func Dryrun(ctx context.Context) bool
- func GetOutboundIP() net.IP
- func JobError(ctx context.Context) error
- func Logger(ctx context.Context) logrus.FieldLogger
- func NewLineWriter(handlers ...LineHandler) io.Writer
- func SetJobError(ctx context.Context, err error)
- func WithDryrun(ctx context.Context, dryrun bool) context.Context
- func WithJobErrorContainer(ctx context.Context) context.Context
- func WithLogger(ctx context.Context, logger logrus.FieldLogger) context.Context
- type Conditional
- type Drawing
- type Executor
- func NewConditionalExecutor(conditional Conditional, trueExecutor Executor, falseExecutor Executor) Executor
- func NewDebugExecutor(format string, args ...interface{}) Executor
- func NewErrorExecutor(err error) Executor
- func NewInfoExecutor(format string, args ...interface{}) Executor
- func NewParallelExecutor(parallel int, executors ...Executor) Executor
- func NewPipelineExecutor(executors ...Executor) Executor
- type LineHandler
- type Pen
- type Style
- type Warning
Constants ¶
const ( StyleDoubleLine = iota StyleSingleLine StyleDashedLine StyleNoLine )
Styles
Variables ¶
This section is empty.
Functions ¶
func CartesianProduct ¶
CartesianProduct takes map of lists and returns list of unique tuples
func GetOutboundIP ¶ added in v0.2.25
GetOutboundIP returns an outbound IP address of this machine. It tries to access the internet and returns the local IP address of the connection. If the machine cannot access the internet, it returns a preferred IP address from network interfaces. It returns nil if no IP address is found.
func Logger ¶
func Logger(ctx context.Context) logrus.FieldLogger
Logger returns the appropriate logger for current context
func NewLineWriter ¶
func NewLineWriter(handlers ...LineHandler) io.Writer
NewLineWriter creates a new instance of a line writer
func SetJobError ¶ added in v0.2.26
func WithDryrun ¶
WithDryrun adds a value to the context for dryrun
func WithJobErrorContainer ¶ added in v0.2.26
WithJobErrorContainer adds a value to the context as a container for an error
func WithLogger ¶
WithLogger adds a value to the context for the logger
Types ¶
type Conditional ¶
Conditional define contract for the conditional predicate
type Executor ¶
Executor define contract for the steps of a workflow
func NewConditionalExecutor ¶
func NewConditionalExecutor(conditional Conditional, trueExecutor Executor, falseExecutor Executor) Executor
NewConditionalExecutor creates a new executor based on conditions
func NewDebugExecutor ¶ added in v0.2.2
NewDebugExecutor is an executor that logs messages
func NewErrorExecutor ¶
NewErrorExecutor creates a new executor that always errors out
func NewInfoExecutor ¶
NewInfoExecutor is an executor that logs messages
func NewParallelExecutor ¶
NewParallelExecutor creates a new executor from a parallel of other executors
func NewPipelineExecutor ¶
NewPipelineExecutor creates a new executor from a series of other executors
func (Executor) If ¶
func (e Executor) If(conditional Conditional) Executor
If only runs this executor if conditional is true
func (Executor) IfNot ¶
func (e Executor) IfNot(conditional Conditional) Executor
IfNot only runs this executor if conditional is true
type LineHandler ¶
LineHandler is a callback function for handling a line