Documentation
¶
Index ¶
- type ExecutionServiceBuilder
- func (b *ExecutionServiceBuilder) Build() *application.ExecutionService
- func (b *ExecutionServiceBuilder) WithAgentRegistry(registry ports.AgentRegistry) *ExecutionServiceBuilder
- func (b *ExecutionServiceBuilder) WithEvaluator(evaluator interface{}) *ExecutionServiceBuilder
- func (b *ExecutionServiceBuilder) WithExecutor(executor ports.CommandExecutor) *ExecutionServiceBuilder
- func (b *ExecutionServiceBuilder) WithLogger(logger ports.Logger) *ExecutionServiceBuilder
- func (b *ExecutionServiceBuilder) WithOutputWriters(stdout, stderr io.Writer) *ExecutionServiceBuilder
- func (b *ExecutionServiceBuilder) WithStateStore(store ports.StateStore) *ExecutionServiceBuilder
- func (b *ExecutionServiceBuilder) WithValidator(validator ports.ExpressionValidator) *ExecutionServiceBuilder
- func (b *ExecutionServiceBuilder) WithWorkflowRepository(repository ports.WorkflowRepository) *ExecutionServiceBuilder
- type StepBuilder
- func (b *StepBuilder) Build() *workflow.Step
- func (b *StepBuilder) WithAgent(agent *workflow.AgentConfig) *StepBuilder
- func (b *StepBuilder) WithBranches(branches ...string) *StepBuilder
- func (b *StepBuilder) WithCallWorkflow(config *workflow.CallWorkflowConfig) *StepBuilder
- func (b *StepBuilder) WithCapture(capture *workflow.CaptureConfig) *StepBuilder
- func (b *StepBuilder) WithCommand(command string) *StepBuilder
- func (b *StepBuilder) WithContinueOnError(continueOnError bool) *StepBuilder
- func (b *StepBuilder) WithDependsOn(deps ...string) *StepBuilder
- func (b *StepBuilder) WithDescription(description string) *StepBuilder
- func (b *StepBuilder) WithDir(dir string) *StepBuilder
- func (b *StepBuilder) WithExitCode(code int) *StepBuilder
- func (b *StepBuilder) WithLoop(loop *workflow.LoopConfig) *StepBuilder
- func (b *StepBuilder) WithMaxConcurrent(maxConcurrent int) *StepBuilder
- func (b *StepBuilder) WithMessage(message string) *StepBuilder
- func (b *StepBuilder) WithOnFailure(nextState string) *StepBuilder
- func (b *StepBuilder) WithOnSuccess(nextState string) *StepBuilder
- func (b *StepBuilder) WithOperation(operation string, inputs map[string]any) *StepBuilder
- func (b *StepBuilder) WithRetry(retry *workflow.RetryConfig) *StepBuilder
- func (b *StepBuilder) WithScriptFile(scriptFile string) *StepBuilder
- func (b *StepBuilder) WithStatus(status workflow.TerminalStatus) *StepBuilder
- func (b *StepBuilder) WithStrategy(strategy string) *StepBuilder
- func (b *StepBuilder) WithTimeout(seconds int) *StepBuilder
- func (b *StepBuilder) WithTransitions(transitions workflow.Transitions) *StepBuilder
- func (b *StepBuilder) WithType(stepType workflow.StepType) *StepBuilder
- type WorkflowBuilder
- func (b *WorkflowBuilder) Build() *workflow.Workflow
- func (b *WorkflowBuilder) WithAuthor(author string) *WorkflowBuilder
- func (b *WorkflowBuilder) WithDescription(description string) *WorkflowBuilder
- func (b *WorkflowBuilder) WithEnv(vars ...string) *WorkflowBuilder
- func (b *WorkflowBuilder) WithInitial(initial string) *WorkflowBuilder
- func (b *WorkflowBuilder) WithInput(input *workflow.Input) *WorkflowBuilder
- func (b *WorkflowBuilder) WithName(name string) *WorkflowBuilder
- func (b *WorkflowBuilder) WithStep(step *workflow.Step) *WorkflowBuilder
- func (b *WorkflowBuilder) WithSteps(steps ...*workflow.Step) *WorkflowBuilder
- func (b *WorkflowBuilder) WithTags(tags ...string) *WorkflowBuilder
- func (b *WorkflowBuilder) WithVersion(version string) *WorkflowBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutionServiceBuilder ¶
type ExecutionServiceBuilder struct {
// contains filtered or unexported fields
}
ExecutionServiceBuilder provides a fluent API for constructing ExecutionService instances with sensible defaults, following the MockProvider pattern (ADR-003). Reduces test setup from 30+ lines to 2-3 lines (93% reduction). Thread-safe: uses sync.RWMutex to protect concurrent access.
func NewExecutionServiceBuilder ¶
func NewExecutionServiceBuilder() *ExecutionServiceBuilder
NewExecutionServiceBuilder creates a new ExecutionServiceBuilder with default dependencies. All dependencies default to mock implementations suitable for testing.
func (*ExecutionServiceBuilder) Build ¶
func (b *ExecutionServiceBuilder) Build() *application.ExecutionService
Build constructs the ExecutionService with the configured dependencies. Uses sensible defaults for any components not explicitly set. Returns a fully initialized ExecutionService ready for testing.
func (*ExecutionServiceBuilder) WithAgentRegistry ¶
func (b *ExecutionServiceBuilder) WithAgentRegistry(registry ports.AgentRegistry) *ExecutionServiceBuilder
WithAgentRegistry configures the agent registry for the ExecutionService. If nil, a default AgentRegistry will be created.
func (*ExecutionServiceBuilder) WithEvaluator ¶
func (b *ExecutionServiceBuilder) WithEvaluator(evaluator interface{}) *ExecutionServiceBuilder
WithEvaluator configures the expression evaluator for conditional transitions. Accepts application.ExpressionEvaluator interface for evaluating "when" clauses.
func (*ExecutionServiceBuilder) WithExecutor ¶
func (b *ExecutionServiceBuilder) WithExecutor(executor ports.CommandExecutor) *ExecutionServiceBuilder
WithExecutor configures the command executor for the ExecutionService. If nil, a default MockCommandExecutor will be used.
func (*ExecutionServiceBuilder) WithLogger ¶
func (b *ExecutionServiceBuilder) WithLogger(logger ports.Logger) *ExecutionServiceBuilder
WithLogger configures the logger for the ExecutionService. If nil, a default MockLogger will be used.
func (*ExecutionServiceBuilder) WithOutputWriters ¶
func (b *ExecutionServiceBuilder) WithOutputWriters(stdout, stderr io.Writer) *ExecutionServiceBuilder
WithOutputWriters configures stdout and stderr writers for the ExecutionService. If nil, default writers will be used (typically os.Stdout/os.Stderr).
func (*ExecutionServiceBuilder) WithStateStore ¶
func (b *ExecutionServiceBuilder) WithStateStore(store ports.StateStore) *ExecutionServiceBuilder
WithStateStore configures the state store for the ExecutionService. If nil, a default MockStateStore will be used.
func (*ExecutionServiceBuilder) WithValidator ¶
func (b *ExecutionServiceBuilder) WithValidator(validator ports.ExpressionValidator) *ExecutionServiceBuilder
WithValidator configures the expression validator for workflow validation. If nil, no expression validation will be performed (safe for tests not exercising ValidateWorkflow).
func (*ExecutionServiceBuilder) WithWorkflowRepository ¶
func (b *ExecutionServiceBuilder) WithWorkflowRepository(repository ports.WorkflowRepository) *ExecutionServiceBuilder
WithWorkflowRepository configures the workflow repository for the ExecutionService. If nil, a default MockWorkflowRepository will be used.
type StepBuilder ¶
type StepBuilder struct {
// contains filtered or unexported fields
}
StepBuilder provides a fluent API for constructing Step instances with sensible defaults for different step types. Supports all step types: command, parallel, terminal, for_each, while, operation, call_workflow, agent.
func NewCommandStep ¶
func NewCommandStep(name, command string) *StepBuilder
NewCommandStep creates a new StepBuilder for a command step.
func NewParallelStep ¶
func NewParallelStep(name string, branches ...string) *StepBuilder
NewParallelStep creates a new StepBuilder for a parallel step.
func NewStepBuilder ¶
func NewStepBuilder(name string) *StepBuilder
NewStepBuilder creates a new StepBuilder with minimal defaults. Default step is a terminal step with success status.
func NewTerminalStep ¶
func NewTerminalStep(name string, status workflow.TerminalStatus) *StepBuilder
NewTerminalStep creates a new StepBuilder for a terminal step.
func (*StepBuilder) Build ¶
func (b *StepBuilder) Build() *workflow.Step
Build returns the constructed Step.
func (*StepBuilder) WithAgent ¶
func (b *StepBuilder) WithAgent(agent *workflow.AgentConfig) *StepBuilder
WithAgent sets AI agent configuration for agent-type steps.
func (*StepBuilder) WithBranches ¶
func (b *StepBuilder) WithBranches(branches ...string) *StepBuilder
WithBranches sets the branches for parallel-type steps.
func (*StepBuilder) WithCallWorkflow ¶
func (b *StepBuilder) WithCallWorkflow(config *workflow.CallWorkflowConfig) *StepBuilder
WithCallWorkflow sets sub-workflow configuration for call_workflow steps.
func (*StepBuilder) WithCapture ¶
func (b *StepBuilder) WithCapture(capture *workflow.CaptureConfig) *StepBuilder
WithCapture sets output capture configuration.
func (*StepBuilder) WithCommand ¶
func (b *StepBuilder) WithCommand(command string) *StepBuilder
WithCommand sets the command for command-type steps.
func (*StepBuilder) WithContinueOnError ¶
func (b *StepBuilder) WithContinueOnError(continueOnError bool) *StepBuilder
WithContinueOnError sets whether to continue on error.
func (*StepBuilder) WithDependsOn ¶
func (b *StepBuilder) WithDependsOn(deps ...string) *StepBuilder
WithDependsOn sets step dependencies.
func (*StepBuilder) WithDescription ¶
func (b *StepBuilder) WithDescription(description string) *StepBuilder
WithDescription sets the step description.
func (*StepBuilder) WithDir ¶
func (b *StepBuilder) WithDir(dir string) *StepBuilder
WithDir sets the working directory for command execution.
func (*StepBuilder) WithExitCode ¶
func (b *StepBuilder) WithExitCode(code int) *StepBuilder
WithExitCode sets the process exit code for terminal-type steps (FR-004). Defaults to 0; inline error terminals default to 1 at parse time.
func (*StepBuilder) WithLoop ¶
func (b *StepBuilder) WithLoop(loop *workflow.LoopConfig) *StepBuilder
WithLoop sets loop configuration for for_each and while steps.
func (*StepBuilder) WithMaxConcurrent ¶
func (b *StepBuilder) WithMaxConcurrent(maxConcurrent int) *StepBuilder
WithMaxConcurrent sets the maximum concurrent branches for parallel steps.
func (*StepBuilder) WithMessage ¶
func (b *StepBuilder) WithMessage(message string) *StepBuilder
WithMessage sets the message template for terminal-type steps. The message is stored as-is and interpolated at runtime.
func (*StepBuilder) WithOnFailure ¶
func (b *StepBuilder) WithOnFailure(nextState string) *StepBuilder
WithOnFailure sets the next state on failure (legacy).
func (*StepBuilder) WithOnSuccess ¶
func (b *StepBuilder) WithOnSuccess(nextState string) *StepBuilder
WithOnSuccess sets the next state on success (legacy).
func (*StepBuilder) WithOperation ¶
func (b *StepBuilder) WithOperation(operation string, inputs map[string]any) *StepBuilder
WithOperation sets operation details for operation-type steps.
func (*StepBuilder) WithRetry ¶
func (b *StepBuilder) WithRetry(retry *workflow.RetryConfig) *StepBuilder
WithRetry sets retry configuration.
func (*StepBuilder) WithScriptFile ¶
func (b *StepBuilder) WithScriptFile(scriptFile string) *StepBuilder
WithScriptFile sets the script_file field for the step.
func (*StepBuilder) WithStatus ¶
func (b *StepBuilder) WithStatus(status workflow.TerminalStatus) *StepBuilder
WithStatus sets the terminal status for terminal-type steps.
func (*StepBuilder) WithStrategy ¶
func (b *StepBuilder) WithStrategy(strategy string) *StepBuilder
WithStrategy sets the parallel execution strategy.
func (*StepBuilder) WithTimeout ¶
func (b *StepBuilder) WithTimeout(seconds int) *StepBuilder
WithTimeout sets the step timeout in seconds.
func (*StepBuilder) WithTransitions ¶
func (b *StepBuilder) WithTransitions(transitions workflow.Transitions) *StepBuilder
WithTransitions sets conditional transitions.
func (*StepBuilder) WithType ¶
func (b *StepBuilder) WithType(stepType workflow.StepType) *StepBuilder
WithType sets the step type.
type WorkflowBuilder ¶
type WorkflowBuilder struct {
// contains filtered or unexported fields
}
WorkflowBuilder provides a fluent API for constructing Workflow instances with sensible defaults, following the builder pattern (ADR-003). Simplifies test workflow creation with progressive configuration.
func NewWorkflowBuilder ¶
func NewWorkflowBuilder() *WorkflowBuilder
NewWorkflowBuilder creates a new WorkflowBuilder with sensible defaults. Default workflow has: - Name: "test-workflow" - Initial: "start" - One step named "start" of type terminal with success status
func (*WorkflowBuilder) Build ¶
func (b *WorkflowBuilder) Build() *workflow.Workflow
Build returns the constructed Workflow.
func (*WorkflowBuilder) WithAuthor ¶
func (b *WorkflowBuilder) WithAuthor(author string) *WorkflowBuilder
WithAuthor sets the workflow author.
func (*WorkflowBuilder) WithDescription ¶
func (b *WorkflowBuilder) WithDescription(description string) *WorkflowBuilder
WithDescription sets the workflow description.
func (*WorkflowBuilder) WithEnv ¶
func (b *WorkflowBuilder) WithEnv(vars ...string) *WorkflowBuilder
WithEnv adds required environment variables.
func (*WorkflowBuilder) WithInitial ¶
func (b *WorkflowBuilder) WithInitial(initial string) *WorkflowBuilder
WithInitial sets the initial state name.
func (*WorkflowBuilder) WithInput ¶
func (b *WorkflowBuilder) WithInput(input *workflow.Input) *WorkflowBuilder
WithInput adds an input parameter to the workflow.
func (*WorkflowBuilder) WithName ¶
func (b *WorkflowBuilder) WithName(name string) *WorkflowBuilder
WithName sets the workflow name.
func (*WorkflowBuilder) WithStep ¶
func (b *WorkflowBuilder) WithStep(step *workflow.Step) *WorkflowBuilder
WithStep adds a step to the workflow. If a step with the same name exists, it is replaced.
func (*WorkflowBuilder) WithSteps ¶
func (b *WorkflowBuilder) WithSteps(steps ...*workflow.Step) *WorkflowBuilder
WithSteps adds multiple steps to the workflow.
func (*WorkflowBuilder) WithTags ¶
func (b *WorkflowBuilder) WithTags(tags ...string) *WorkflowBuilder
WithTags sets the workflow tags.
func (*WorkflowBuilder) WithVersion ¶
func (b *WorkflowBuilder) WithVersion(version string) *WorkflowBuilder
WithVersion sets the workflow version.