Documentation ¶
Index ¶
- func ArgsFromEnvVars() ([]string, error)
- func Int(v int) *int
- func Register(stepLoader StepLoader)
- type AnyMap
- type Application
- func (p *Application) Color() bool
- func (p Application) DirectInputValuesForTaskKey(taskName TaskName, args []string, arguments task.Arguments, ...) (map[string]interface{}, error)
- func (p Application) GetTmplOrTypedValueForConfigKey(k string, tpe string, bindEnvVars bool) interface{}
- func (p Application) InheritedInputValuesForTaskKey(taskName TaskName, args []string, arguments task.Arguments, ...) (map[string]interface{}, error)
- func (p *Application) Run(taskName TaskName, args []string) error
- func (p *Application) RunTask(taskName TaskName, args []string, arguments task.Arguments, ...) (string, error)
- func (p *Application) RunTaskForKeyString(keyStr string, args []string, arguments task.Arguments, ...) (string, error)
- func (p *Application) Tasks() map[string]*Task
- func (p *Application) UpdateLoggingConfiguration() error
- type Artifact
- type Caller
- type CobraAdapter
- type CobraApp
- type CommandError
- type ExecutionContext
- func (c ExecutionContext) Autodir() bool
- func (c ExecutionContext) Autoenv() bool
- func (c ExecutionContext) Caller() []Caller
- func (c ExecutionContext) GenerateAutoenv() (map[string]string, error)
- func (c ExecutionContext) Interactive() bool
- func (c ExecutionContext) Key() Key
- func (c ExecutionContext) Render(expr string, name string) (string, error)
- func (c ExecutionContext) RunAnotherTask(key string, arguments task.Arguments, scope map[string]interface{}) (string, error)
- func (c ExecutionContext) Values() map[string]interface{}
- func (c ExecutionContext) Vars() map[string]interface{}
- func (c ExecutionContext) WithAdditionalValues(vs map[string]interface{}) ExecutionContext
- type IfStep
- type IfStepLoader
- type InitError
- type Input
- type InputConfig
- func (c *InputConfig) DefaultAsArray() ([]interface{}, error)
- func (c *InputConfig) DefaultAsBool() bool
- func (c *InputConfig) DefaultAsInt() int
- func (c *InputConfig) DefaultAsObject() (map[string]interface{}, error)
- func (c *InputConfig) DefaultAsString() string
- func (c *InputConfig) GoString() string
- func (c *InputConfig) JSONSchema() map[string]interface{}
- func (c *InputConfig) Required() bool
- func (c *InputConfig) TypeName() string
- type InputConfigs
- type InputResolver
- type InternalError
- type Key
- type LoadingContext
- type MessageOnlyFormatter
- type OptionConfig
- type Opts
- type OrStep
- type OrStepLoader
- type ParameterConfig
- type RegistryBasedInputResolver
- type RunnerConfig
- type ScriptStep
- type ScriptStepLoader
- type Step
- type StepDef
- type StepLoader
- type StepStringOutput
- type Task
- type TaskCreator
- type TaskDef
- type TaskDefV1
- type TaskDefV2
- type TaskDefs
- type TaskName
- type TaskNamer
- type TaskRegistry
- type TaskRunner
- func (t TaskRunner) AsStepCaller() Caller
- func (t TaskRunner) GenerateAutoenv() (map[string]string, error)
- func (t TaskRunner) GenerateAutoenvRecursively(path string, env map[string]interface{}, toEnvName func(string) string) (map[string]string, error)
- func (t TaskRunner) GetKey() Key
- func (t *TaskRunner) Run(project *Application, asInput bool, caller ...*Task) (string, error)
- type TaskStep
- type TaskStepLoader
- type TaskTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgsFromEnvVars ¶ added in v0.35.0
func Register ¶
func Register(stepLoader StepLoader)
Types ¶
type Application ¶
type Application struct { Name string CommandRelativePath string CachedTaskOutputs map[string]interface{} ConfigFile string Verbose bool Output string Colorize bool NoColorize bool Env string TaskRegistry *TaskRegistry InputResolver InputResolver TaskNamer *TaskNamer LogToStderr bool LogLevel string LogColorPanic string LogColorFatal string LogColorError string LogColorWarn string LogColorInfo string LogColorDebug string LogColorTrace string LastRun string LastOutputs map[string]string Viper *viper.Viper Log *logrus.Logger ConfigContexts []string ConfigDirs []string CommandName string }
func (*Application) Color ¶ added in v0.34.0
func (p *Application) Color() bool
func (Application) DirectInputValuesForTaskKey ¶
func (Application) GetTmplOrTypedValueForConfigKey ¶
func (p Application) GetTmplOrTypedValueForConfigKey(k string, tpe string, bindEnvVars bool) interface{}
func (Application) InheritedInputValuesForTaskKey ¶
func (*Application) Run ¶ added in v0.25.2
func (p *Application) Run(taskName TaskName, args []string) error
func (*Application) RunTaskForKeyString ¶
func (*Application) Tasks ¶
func (p *Application) Tasks() map[string]*Task
func (*Application) UpdateLoggingConfiguration ¶
func (p *Application) UpdateLoggingConfiguration() error
type CobraAdapter ¶
type CobraAdapter struct {
// contains filtered or unexported fields
}
func NewCobraAdapter ¶
func NewCobraAdapter(app *Application) *CobraAdapter
func (*CobraAdapter) GenerateAllFlags ¶
func (p *CobraAdapter) GenerateAllFlags()
func (*CobraAdapter) GenerateCommand ¶
func (*CobraAdapter) Tasks ¶
func (p *CobraAdapter) Tasks() map[string]*Task
type CobraApp ¶ added in v0.26.0
type CobraApp struct { VariantApp *Application // contains filtered or unexported fields }
type CommandError ¶ added in v0.25.2
type ExecutionContext ¶
type ExecutionContext struct {
// contains filtered or unexported fields
}
func NewStepExecutionContext ¶
func NewStepExecutionContext(app Application, taskRunner TaskRunner, taskTemplate *TaskTemplate, asInput bool, trace []*Task) ExecutionContext
func (ExecutionContext) Autodir ¶
func (c ExecutionContext) Autodir() bool
func (ExecutionContext) Autoenv ¶
func (c ExecutionContext) Autoenv() bool
func (ExecutionContext) Caller ¶
func (c ExecutionContext) Caller() []Caller
func (ExecutionContext) GenerateAutoenv ¶
func (c ExecutionContext) GenerateAutoenv() (map[string]string, error)
func (ExecutionContext) Interactive ¶
func (c ExecutionContext) Interactive() bool
func (ExecutionContext) Key ¶
func (c ExecutionContext) Key() Key
func (ExecutionContext) Render ¶
func (c ExecutionContext) Render(expr string, name string) (string, error)
func (ExecutionContext) RunAnotherTask ¶
func (ExecutionContext) Values ¶ added in v0.29.0
func (c ExecutionContext) Values() map[string]interface{}
func (ExecutionContext) Vars ¶
func (c ExecutionContext) Vars() map[string]interface{}
func (ExecutionContext) WithAdditionalValues ¶ added in v0.28.0
func (c ExecutionContext) WithAdditionalValues(vs map[string]interface{}) ExecutionContext
type IfStep ¶
func (IfStep) Run ¶
func (s IfStep) Run(context ExecutionContext) (StepStringOutput, error)
type IfStepLoader ¶
type IfStepLoader struct{}
func NewIfStepLoader ¶
func NewIfStepLoader() IfStepLoader
func (IfStepLoader) LoadStep ¶
func (l IfStepLoader) LoadStep(config StepDef, context LoadingContext) (Step, error)
type InitError ¶ added in v0.29.0
type InitError struct {
// contains filtered or unexported fields
}
func NewInitError ¶ added in v0.36.0
type Input ¶
type Input struct { InputConfig TaskKey TaskName FullName string }
type InputConfig ¶
type InputConfig struct { Name string `yaml:"name,omitempty"` Description string `yaml:"description,omitempty"` ArgumentIndex *int `yaml:"argument-index,omitempty"` Type string `yaml:"type,omitempty"` Default interface{} `yaml:"default,omitempty"` Properties map[string]map[string]interface{} `yaml:"properties,omitempty"` Remainings map[string]interface{} `yaml:",inline"` }
func (*InputConfig) DefaultAsArray ¶
func (c *InputConfig) DefaultAsArray() ([]interface{}, error)
func (*InputConfig) DefaultAsBool ¶
func (c *InputConfig) DefaultAsBool() bool
func (*InputConfig) DefaultAsInt ¶
func (c *InputConfig) DefaultAsInt() int
func (*InputConfig) DefaultAsObject ¶
func (c *InputConfig) DefaultAsObject() (map[string]interface{}, error)
func (*InputConfig) DefaultAsString ¶
func (c *InputConfig) DefaultAsString() string
func (*InputConfig) GoString ¶ added in v0.26.0
func (c *InputConfig) GoString() string
func (*InputConfig) JSONSchema ¶
func (c *InputConfig) JSONSchema() map[string]interface{}
func (*InputConfig) Required ¶
func (c *InputConfig) Required() bool
func (*InputConfig) TypeName ¶
func (c *InputConfig) TypeName() string
type InputConfigs ¶ added in v0.26.0
type InputConfigs []*InputConfig
func (InputConfigs) GoString ¶ added in v0.26.0
func (c InputConfigs) GoString() string
type InputResolver ¶
type InputResolver interface { ResolveInputs() ResolveInputsForTask(flowDef *Task) []*Input ResolveInputsForTaskKey(currentTaskKey TaskName, path string) []*Input }
func NewRegistryBasedInputResolver ¶
func NewRegistryBasedInputResolver(registry *TaskRegistry, flowKeyCreator *TaskNamer) InputResolver
type InternalError ¶ added in v0.36.4
type InternalError struct {
// contains filtered or unexported fields
}
func NewInternalError ¶ added in v0.36.4
func NewInternalError(err error) InternalError
type LoadingContext ¶
type MessageOnlyFormatter ¶
type MessageOnlyFormatter struct { }
type OptionConfig ¶
type OptionConfig struct { Name string `yaml:"name,omitempty"` Description string `yaml:"description,omitempty"` Type string `yaml:"type,omitempty"` Default interface{} `yaml:"default,omitempty"` Required bool `yaml:"required,omitempty"` Properties map[string]map[string]interface{} `yaml:"properties,omitempty"` Remainings map[string]interface{} `yaml:",inline"` }
type OrStep ¶
func (OrStep) Run ¶
func (s OrStep) Run(context ExecutionContext) (StepStringOutput, error)
type OrStepLoader ¶
type OrStepLoader struct{}
func NewOrStepLoader ¶
func NewOrStepLoader() OrStepLoader
func (OrStepLoader) LoadStep ¶
func (l OrStepLoader) LoadStep(config StepDef, context LoadingContext) (Step, error)
type ParameterConfig ¶
type ParameterConfig struct { Name string `yaml:"name,omitempty"` Description string `yaml:"description,omitempty"` Type string `yaml:"type,omitempty"` Default interface{} `yaml:"default,omitempty"` Required bool `yaml:"required,omitempty"` Properties map[string]map[string]interface{} `yaml:"properties,omitempty"` Remainings map[string]interface{} `yaml:",inline"` }
type RegistryBasedInputResolver ¶
type RegistryBasedInputResolver struct { InputResolver // contains filtered or unexported fields }
func (*RegistryBasedInputResolver) ResolveInputs ¶
func (r *RegistryBasedInputResolver) ResolveInputs()
func (*RegistryBasedInputResolver) ResolveInputsForTask ¶
func (r *RegistryBasedInputResolver) ResolveInputsForTask(flowDef *Task) []*Input
func (*RegistryBasedInputResolver) ResolveInputsForTaskKey ¶
func (r *RegistryBasedInputResolver) ResolveInputsForTaskKey(currentTaskKey TaskName, path string) []*Input
type RunnerConfig ¶ added in v0.26.0
type ScriptStep ¶
type ScriptStep struct { Name string Code string Silent bool RunnerConfig RunnerConfig }
func (ScriptStep) GetName ¶
func (s ScriptStep) GetName() string
func (ScriptStep) Run ¶
func (s ScriptStep) Run(context ExecutionContext) (StepStringOutput, error)
func (ScriptStep) Silenced ¶ added in v0.26.0
func (s ScriptStep) Silenced() bool
type ScriptStepLoader ¶
type ScriptStepLoader struct{}
func NewScriptStepLoader ¶
func NewScriptStepLoader() ScriptStepLoader
func (ScriptStepLoader) LoadStep ¶
func (l ScriptStepLoader) LoadStep(def StepDef, context LoadingContext) (Step, error)
type Step ¶
type Step interface { GetName() string Run(context ExecutionContext) (StepStringOutput, error) Silenced() bool }
type StepDef ¶
type StepDef struct {
// contains filtered or unexported fields
}
func NewStepDef ¶
func (StepDef) GetStringMapOrEmpty ¶
type StepLoader ¶
type StepLoader interface {
LoadStep(config StepDef, context LoadingContext) (Step, error)
}
type StepStringOutput ¶
type StepStringOutput struct {
String string
}
type Task ¶
type TaskCreator ¶
type TaskCreator struct {
// contains filtered or unexported fields
}
func NewTaskCreator ¶
func NewTaskCreator(c *TaskNamer) *TaskCreator
type TaskDef ¶
type TaskDef struct { Name string `yaml:"name,omitempty"` Description string `yaml:"description,omitempty"` Inputs InputConfigs `yaml:"inputs,omitempty"` TaskDefs TaskDefs `yaml:"tasks,omitempty"` Script string `yaml:"script,omitempty"` Steps []Step `yaml:"steps,omitempty"` Autoenv bool `yaml:"autoenv,omitempty"` Autodir bool `yaml:"autodir,omitempty"` BindParamsFromEnv bool `yaml:"bindParamsFromEnv,omitempty"` Interactive bool `yaml:"interactive,omitempty"` Private bool `yaml:"private,omitempty"` // contains filtered or unexported fields }
func NewDefaultTaskConfig ¶
func NewDefaultTaskConfig() *TaskDef
func ReadTaskDefFromBytes ¶ added in v0.24.0
func ReadTaskDefFromFile ¶ added in v0.24.0
func ReadTaskDefFromString ¶ added in v0.24.0
func (*TaskDef) UnmarshalYAML ¶
type TaskDefV1 ¶
type TaskDefV1 struct { Name string `yaml:"name,omitempty"` Description string `yaml:"description,omitempty"` Inputs []*InputConfig `yaml:"inputs,omitempty"` Parameters []*ParameterConfig `yaml:"parameters,omitempty"` Options []*OptionConfig `yaml:"options,omitempty"` TaskDefs []*TaskDef `yaml:"tasks,omitempty"` Runner map[string]interface{} `yaml:"runner,omitempty"` Script string `yaml:"script,omitempty"` StepDefs []map[interface{}]interface{} `yaml:"steps,omitempty"` Autoenv bool `yaml:"autoenv,omitempty"` Autodir bool `yaml:"autodir,omitempty"` BindEnvVar bool `yaml:"bindParamsFromEnv,omitempty"` Interactive bool `yaml:"interactive,omitempty"` Private bool `yaml:"private,omitempty"` }
type TaskDefV2 ¶
type TaskDefV2 struct { Description string `yaml:"description,omitempty"` Inputs []*InputConfig `yaml:"inputs,omitempty"` Parameters []*ParameterConfig `yaml:"parameters,omitempty"` Options []*OptionConfig `yaml:"options,omitempty"` Import string `yaml:"import,omitempty"` TaskDefs map[string]*TaskDef `yaml:"tasks,omitempty"` Runner map[string]interface{} `yaml:"runner,omitempty"` Script interface{} `yaml:"script,omitempty"` StepDefs []map[interface{}]interface{} `yaml:"steps,omitempty"` Autoenv bool `yaml:"autoenv,omitempty"` Autodir bool `yaml:"autodir,omitempty"` BindEnvVar bool `yaml:"bindParamsFromEnv,omitempty"` Interactive bool `yaml:"interactive,omitempty"` Private bool `yaml:"private,omitempty"` }
type TaskNamer ¶
type TaskNamer struct {
AppName string
}
func NewTaskNamer ¶
func (TaskNamer) FromInput ¶
func (p TaskNamer) FromInput(input *InputConfig) TaskName
func (TaskNamer) FromInputName ¶
func (TaskNamer) FromResolvedInput ¶
func (TaskNamer) FromString ¶
type TaskRegistry ¶
type TaskRegistry struct {
// contains filtered or unexported fields
}
func NewTaskRegistry ¶
func NewTaskRegistry() *TaskRegistry
func (*TaskRegistry) AllTaskKeys ¶
func (p *TaskRegistry) AllTaskKeys() []string
func (*TaskRegistry) FindTask ¶
func (p *TaskRegistry) FindTask(name TaskName) *Task
func (*TaskRegistry) RegisterTasks ¶
func (p *TaskRegistry) RegisterTasks(task *Task)
func (*TaskRegistry) Tasks ¶
func (p *TaskRegistry) Tasks() map[string]*Task
type TaskRunner ¶
type TaskRunner struct { *Task Values map[string]interface{} Template *TaskTemplate }
func NewTaskRunner ¶
func NewTaskRunner(taskDef *Task, taskTemplate *TaskTemplate, vars map[string]interface{}) (TaskRunner, error)
func (TaskRunner) AsStepCaller ¶
func (t TaskRunner) AsStepCaller() Caller
func (TaskRunner) GenerateAutoenv ¶
func (t TaskRunner) GenerateAutoenv() (map[string]string, error)
func (TaskRunner) GenerateAutoenvRecursively ¶
func (TaskRunner) GetKey ¶
func (t TaskRunner) GetKey() Key
func (*TaskRunner) Run ¶
func (t *TaskRunner) Run(project *Application, asInput bool, caller ...*Task) (string, error)
type TaskStep ¶
func (TaskStep) Run ¶
func (s TaskStep) Run(context ExecutionContext) (StepStringOutput, error)
type TaskStepLoader ¶
type TaskStepLoader struct{}
func NewTaskStepLoader ¶
func NewTaskStepLoader() TaskStepLoader
func (TaskStepLoader) LoadStep ¶
func (l TaskStepLoader) LoadStep(stepConfig StepDef, context LoadingContext) (Step, error)
type TaskTemplate ¶
type TaskTemplate struct {
// contains filtered or unexported fields
}
func NewTaskTemplate ¶
func NewTaskTemplate(task *Task, values map[string]interface{}) *TaskTemplate
func (*TaskTemplate) Render ¶
func (t *TaskTemplate) Render(expr string, name string) (string, error)
func (*TaskTemplate) WithAdditionalValues ¶ added in v0.28.0
func (t *TaskTemplate) WithAdditionalValues(vs map[string]interface{}) *TaskTemplate
Source Files ¶
- application.go
- args_from_envvars.go
- cobra.go
- input.go
- input_config.go
- input_resolver.go
- message_only_formatter.go
- step.go
- step_def.go
- step_execution_context.go
- step_if.go
- step_loader.go
- step_or.go
- step_script.go
- step_task.go
- task.go
- task_creator.go
- task_def.go
- task_def_loader.go
- task_name.go
- task_namer.go
- task_registry.go
- task_runner.go
- task_template.go
- task_template_funcs.go
- util.go
- variant.go
- variant_text_log_formatter.go
Click to show internal directories.
Click to hide internal directories.