Documentation ¶
Overview ¶
Package middleware slices the implementation into middlewares, each performing side effects and adapting the run based on provided arguments
Index ¶
- func LookUpPipelineDefinition(definitionsLookup pipeline.PipelineDefinitionsLookup, identifier string, ...) (*pipeline.PipelineDefinition, bool)
- func ParseArguments(middlewareArguments interface{}, middlewareIdentifier string, ...) bool
- func ParseArgumentsIncludingParents(middlewareArguments interface{}, middlewareIdentifier string, ...) bool
- type Arguments
- type ExecutionContext
- func (executionContext *ExecutionContext) Cancel() error
- func (executionContext *ExecutionContext) CancelAll() error
- func (executionContext *ExecutionContext) Execute(pipelineIdentifier string, writer io.Writer)
- func (executionContext *ExecutionContext) FullRun(options ...FullRunOption) *pipeline.Run
- func (executionContext *ExecutionContext) PipelineFileAtPath(path string) (*pipeline.File, error)
- func (executionContext *ExecutionContext) SetUpPipelines(args []string) error
- type ExecutionContextOption
- func WithActivityIndicator(activityIndicator logging.ActivityIndicator) ExecutionContextOption
- func WithDefinitionsLookup(definitions pipeline.PipelineDefinitionsLookup) ExecutionContextOption
- func WithExecutionFunction(executionFunction func(run *pipeline.Run)) ExecutionContextOption
- func WithLogger(logger *logrus.Logger) ExecutionContextOption
- func WithMiddlewareStack(stack []Middleware) ExecutionContextOption
- func WithParser(parser *parser.Parser) ExecutionContextOption
- func WithProjectPath(projectPath string) ExecutionContextOption
- func WithUserPromptImplementation(...) ExecutionContextOption
- type FullRunOption
- func WithArguments(arguments map[string]interface{}) FullRunOption
- func WithIdentifier(identifier *string) FullRunOption
- func WithLogWriter(logWriter io.WriteCloser) FullRunOption
- func WithParentRun(parentRun *pipeline.Run) FullRunOption
- func WithSetupFunc(preCallback func(*pipeline.Run)) FullRunOption
- func WithTearDownFunc(postCallback func(*pipeline.Run)) FullRunOption
- type FullRunOptions
- type Middleware
- type PipelineReference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LookUpPipelineDefinition ¶
func LookUpPipelineDefinition(definitionsLookup pipeline.PipelineDefinitionsLookup, identifier string, rootFileName string) (*pipeline.PipelineDefinition, bool)
func ParseArguments ¶
Types ¶
type ExecutionContext ¶
type ExecutionContext struct { PipelineFiles []pipeline.File Definitions pipeline.PipelineDefinitionsLookup MiddlewareStack []Middleware Defaults pipeline.DefaultSettings Hooks pipeline.HookDefinitions Log *logrus.Logger ProjectPath string RootFileName string SelectableFiles []string Runs []*pipeline.Run ActivityIndicator logging.ActivityIndicator UserPromptImplementation func( label string, items []string, initialSelection int, size int, input io.ReadCloser, output io.WriteCloser, ) (int, string, error) // contains filtered or unexported fields }
func NewExecutionContext ¶
func NewExecutionContext(options ...ExecutionContextOption) *ExecutionContext
func (*ExecutionContext) Cancel ¶
func (executionContext *ExecutionContext) Cancel() error
func (*ExecutionContext) CancelAll ¶
func (executionContext *ExecutionContext) CancelAll() error
func (*ExecutionContext) Execute ¶
func (executionContext *ExecutionContext) Execute(pipelineIdentifier string, writer io.Writer)
func (*ExecutionContext) FullRun ¶
func (executionContext *ExecutionContext) FullRun(options ...FullRunOption) *pipeline.Run
func (*ExecutionContext) PipelineFileAtPath ¶
func (executionContext *ExecutionContext) PipelineFileAtPath(path string) (*pipeline.File, error)
func (*ExecutionContext) SetUpPipelines ¶
func (executionContext *ExecutionContext) SetUpPipelines(args []string) error
type ExecutionContextOption ¶
type ExecutionContextOption func(*ExecutionContext)
func WithActivityIndicator ¶
func WithActivityIndicator(activityIndicator logging.ActivityIndicator) ExecutionContextOption
func WithDefinitionsLookup ¶
func WithDefinitionsLookup(definitions pipeline.PipelineDefinitionsLookup) ExecutionContextOption
func WithExecutionFunction ¶
func WithExecutionFunction(executionFunction func(run *pipeline.Run)) ExecutionContextOption
func WithLogger ¶
func WithLogger(logger *logrus.Logger) ExecutionContextOption
func WithMiddlewareStack ¶
func WithMiddlewareStack(stack []Middleware) ExecutionContextOption
func WithParser ¶
func WithParser(parser *parser.Parser) ExecutionContextOption
func WithProjectPath ¶
func WithProjectPath(projectPath string) ExecutionContextOption
func WithUserPromptImplementation ¶
func WithUserPromptImplementation(implementation func( label string, items []string, initialSelection int, size int, input io.ReadCloser, output io.WriteCloser, ) (int, string, error)) ExecutionContextOption
type FullRunOption ¶
type FullRunOption func(*FullRunOptions)
func WithArguments ¶
func WithArguments(arguments map[string]interface{}) FullRunOption
func WithIdentifier ¶
func WithIdentifier(identifier *string) FullRunOption
func WithLogWriter ¶
func WithLogWriter(logWriter io.WriteCloser) FullRunOption
func WithParentRun ¶
func WithParentRun(parentRun *pipeline.Run) FullRunOption
func WithSetupFunc ¶
func WithSetupFunc(preCallback func(*pipeline.Run)) FullRunOption
func WithTearDownFunc ¶
func WithTearDownFunc(postCallback func(*pipeline.Run)) FullRunOption
type FullRunOptions ¶
type FullRunOptions struct {
// contains filtered or unexported fields
}
type Middleware ¶
type PipelineReference ¶
Directories ¶
Path | Synopsis |
---|---|
Package catch provides a middleware for graceful handling of stderr output
|
Package catch provides a middleware for graceful handling of stderr output |
Package catcheach provides a middleware for graceful handling of stderr output based on regex patterns
|
Package catcheach provides a middleware for graceful handling of stderr output based on regex patterns |
Package dir provides a middleware for changing the current working directory
|
Package dir provides a middleware for changing the current working directory |
Package docker provides a middleware for execution within a Docker (Compose) container
|
Package docker provides a middleware for execution within a Docker (Compose) container |
Package each provides a middleware that copies some input into several child pipes running simultaneously
|
Package each provides a middleware that copies some input into several child pipes running simultaneously |
Package env provides a middleware handling environment variables
|
Package env provides a middleware handling environment variables |
Package inherit provides a middleware that passes arguments from a parent to its children
|
Package inherit provides a middleware that passes arguments from a parent to its children |
Package input provides a middleware to overwrite a pipe's input directly
|
Package input provides a middleware to overwrite a pipe's input directly |
Package interpolate provides a middleware to substitute arguments or inputs into other arguments
|
Package interpolate provides a middleware to substitute arguments or inputs into other arguments |
Package output provides a middleware to overwrite a pipe's output directly
|
Package output provides a middleware to overwrite a pipe's output directly |
Package pipe provides a middleware to execute several commands in sequence
|
Package pipe provides a middleware to execute several commands in sequence |
Package select provides a middleware that shows a selection prompt to the user
|
Package select provides a middleware that shows a selection prompt to the user |
Package shell provides a middleware to execute commands in a shell
|
Package shell provides a middleware to execute commands in a shell |
Package ssh provides a middleware enabling remote command execution via SSH
|
Package ssh provides a middleware enabling remote command execution via SSH |
Package stack defines a list of middleware items to be executed when a pipeline is run
|
Package stack defines a list of middleware items to be executed when a pipeline is run |
Package sync provides a middleware to defer execution until a condition is fulfilled
|
Package sync provides a middleware to defer execution until a condition is fulfilled |
Package timer provides a middleware that records execution time
|
Package timer provides a middleware that records execution time |
Package when provides a middleware that enables conditional execution
|
Package when provides a middleware that enables conditional execution |
Package with provides a middleware that extracts and processes input patterns
|
Package with provides a middleware that extracts and processes input patterns |
Click to show internal directories.
Click to hide internal directories.