Documentation
¶
Index ¶
- func CommandResolution(ctx context.Context, s ir.Step) cmnvalue.CommandContext
- func IsExecutorRegistered(executorType string) bool
- func RegisterExecutorCapabilities(executorType string, caps ExecutorCapabilities)
- func RegisterExecutorConfigSchema(executorType string, schema *jsonschema.Schema)
- func RegisterStepValidator(executorType string, validator StepValidator)
- func ScriptResolution(ctx context.Context, s ir.Step) cmnvalue.CommandContext
- func StepConfigWarnings(s ir.Step) []string
- func UnregisterExecutorCapabilities(executorType string)
- func UnregisterStepValidator(executorType string)
- func ValidateExecutorConfig(executorType string, config map[string]any) error
- func ValidateStep(step ir.Step) error
- type ExecutorCapabilities
- type StepValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandResolution ¶
CommandResolution returns command execution facts for command field resolution.
func IsExecutorRegistered ¶
IsExecutorRegistered reports whether an executor type has registered metadata.
func RegisterExecutorCapabilities ¶
func RegisterExecutorCapabilities(executorType string, caps ExecutorCapabilities)
RegisterExecutorCapabilities registers capabilities for an executor type.
func RegisterExecutorConfigSchema ¶
func RegisterExecutorConfigSchema(executorType string, schema *jsonschema.Schema)
RegisterExecutorConfigSchema registers a JSON schema for an executor config. The schema is used to validate executor config at DAG parse time.
func RegisterStepValidator ¶
func RegisterStepValidator(executorType string, validator StepValidator)
RegisterStepValidator registers a validator for an executor type.
func ScriptResolution ¶
ScriptResolution returns command execution facts for script field resolution.
func StepConfigWarnings ¶
StepConfigWarnings returns the configuration warnings the step's executor reports.
func UnregisterExecutorCapabilities ¶
func UnregisterExecutorCapabilities(executorType string)
UnregisterExecutorCapabilities removes capabilities for an executor type.
func UnregisterStepValidator ¶
func UnregisterStepValidator(executorType string)
UnregisterStepValidator removes the validator for an executor type.
func ValidateExecutorConfig ¶
ValidateExecutorConfig validates config against the registered schema. Returns nil if no schema is registered (backward compatible).
func ValidateStep ¶
ValidateStep runs the registered validator, if any.
Types ¶
type ExecutorCapabilities ¶
type ExecutorCapabilities struct {
// Command indicates whether the executor supports the command field.
Command bool
// MultipleCommands indicates whether the executor supports multiple commands.
MultipleCommands bool
// Script indicates whether the executor supports the script field.
Script bool
// Shell indicates whether the executor uses shell/shellArgs/shellPackages.
Shell bool
// Stdin indicates whether the executor supports the stdin field for piping
// a file's contents to the command's standard input.
Stdin bool
// Container indicates whether the executor supports step-level container config.
Container bool
// SubDAG indicates whether the executor can execute sub-DAGs.
SubDAG bool
// WorkerSelector indicates whether the executor supports worker selection.
WorkerSelector bool
// LLM indicates whether the executor supports the llm field.
LLM bool
// Messages indicates whether the executor takes the messages field and
// requires at least one message when an llm config is present.
Messages bool
// CommandContext returns command execution facts for command field resolution.
CommandContext func(ctx context.Context, step ir.Step) cmnvalue.CommandContext
// ScriptContext returns command execution facts for script field resolution.
ScriptContext func(ctx context.Context, step ir.Step) cmnvalue.CommandContext
// DryRunCheck reports what a dry run can tell will fail on this host, such
// as a file the step reads that does not exist, without running the step.
// It receives the declared step with its with fields resolved as far as a
// dry run can; a value that still holds a reference, such as a step
// output, is left as written and the check must skip it. The error's text
// is shown as a warning and never fails the dry run; several problems can
// be joined into one error.
DryRunCheck func(ctx context.Context, step ir.Step) error
// ConfigWarnings reports settings in the step's configuration that are
// valid but likely give results the author does not expect. Loading the
// DAG shows each message as a warning. It also receives steps that fail
// validation and need not report what validation already does.
ConfigWarnings func(step ir.Step) []string
}
ExecutorCapabilities defines what an executor can do.
func ExecutorCapabilitiesFor ¶
func ExecutorCapabilitiesFor(executorType string) ExecutorCapabilities
ExecutorCapabilitiesFor returns the registered capabilities for an executor type.
type StepValidator ¶
StepValidator validates an executor's step configuration.