Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackoffStrategy ¶
type BackoffStrategy string
BackoffStrategy determines delay between retries
const ( BackoffExponential BackoffStrategy = "exponential" BackoffLinear BackoffStrategy = "linear" BackoffFixed BackoffStrategy = "fixed" )
type CommandExecutor ¶
type CommandExecutor struct {
Shell string
}
CommandExecutor executes shell commands
func NewCommandExecutor ¶
func NewCommandExecutor() *CommandExecutor
NewCommandExecutor creates a new command executor
func (*CommandExecutor) CanHandle ¶
func (e *CommandExecutor) CanHandle(action *semantic.SemanticScheduledAction) bool
CanHandle determines if this executor can process the action
func (*CommandExecutor) Execute ¶
func (e *CommandExecutor) Execute(ctx context.Context, action *semantic.SemanticScheduledAction) (*Result, error)
Execute runs the command and returns the result
func (*CommandExecutor) Name ¶
func (e *CommandExecutor) Name() string
Name returns the executor's identifier
type ExecuteOptions ¶
type ExecuteOptions struct {
// Context for cancellation/timeout
Context context.Context
// RetryPolicy defines retry behavior
RetryPolicy *RetryPolicy
// Dependencies are actions that must complete first
Dependencies []string
// Storage for persisting results
Storage Storage
// Hooks for lifecycle events
Hooks *ExecutionHooks
}
ExecuteWithOptions provides advanced execution control
type ExecutionError ¶
ExecutionError provides detailed error information
func (*ExecutionError) Error ¶
func (e *ExecutionError) Error() string
Error implements the error interface for ExecutionError
type ExecutionHooks ¶
type ExecutionHooks struct {
BeforeExecute func(ctx context.Context, action *semantic.SemanticScheduledAction) error
AfterExecute func(ctx context.Context, action *semantic.SemanticScheduledAction, result *Result) error
OnError func(ctx context.Context, action *semantic.SemanticScheduledAction, err error) error
}
ExecutionHooks allows customization of execution lifecycle
type ExecutionStatus ¶
type ExecutionStatus string
ExecutionStatus represents the state of execution
const ( StatusPending ExecutionStatus = "pending" StatusRunning ExecutionStatus = "running" StatusCompleted ExecutionStatus = "completed" StatusFailed ExecutionStatus = "failed" StatusCancelled ExecutionStatus = "cancelled" )
type Executor ¶
type Executor interface {
// Execute runs an action and returns the result
Execute(ctx context.Context, action *semantic.SemanticScheduledAction) (*Result, error)
// CanHandle determines if this executor can process the action
CanHandle(action *semantic.SemanticScheduledAction) bool
// Name returns the executor's identifier
Name() string
}
Executor is the unified interface for all execution types
type HTTPExecutor ¶
HTTPExecutor executes HTTP-based semantic actions
func NewHTTPExecutor ¶
func NewHTTPExecutor() *HTTPExecutor
NewHTTPExecutor creates a new HTTP executor with default settings
func (*HTTPExecutor) CanHandle ¶
func (e *HTTPExecutor) CanHandle(action *semantic.SemanticScheduledAction) bool
CanHandle determines if this executor can process the action
func (*HTTPExecutor) Execute ¶
func (e *HTTPExecutor) Execute(ctx context.Context, action *semantic.SemanticScheduledAction) (*Result, error)
Execute runs the HTTP action and returns the result
func (*HTTPExecutor) Name ¶
func (e *HTTPExecutor) Name() string
Name returns the executor's identifier
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages executor implementations
type Result ¶
type Result struct {
// Output is the primary execution result (stdout, response body, etc.)
Output string
// Status indicates the execution status
Status ExecutionStatus
// Metadata contains additional execution information
Metadata map[string]interface{}
// Error contains detailed error information if execution failed
Error *ExecutionError
// StartTime when execution began
StartTime time.Time
// EndTime when execution completed
EndTime time.Time
// Duration of execution
Duration time.Duration
}
Result contains the execution output and metadata
type RetryPolicy ¶
type RetryPolicy struct {
MaxAttempts int
Backoff BackoffStrategy
}
RetryPolicy defines retry behavior