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 LoggerHook(ctx context.Context) logrus.Hook
- 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
- func WithLoggerHook(ctx context.Context, hook logrus.Hook) 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 ¶
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 LoggerHook ¶
LoggerHook returns the appropriate logger hook for current context the hook affects job logger, not global logger
func NewLineWriter ¶
func NewLineWriter(handlers ...LineHandler) io.Writer
NewLineWriter creates a new instance of a line writer
func SetJobError ¶
func WithDryrun ¶
WithDryrun adds a value to the context for dryrun
func WithJobErrorContainer ¶
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 ¶
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