Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface {
context.Context
// Step executes a unit of work durably.
// name: Unique identifier for the step within the workflow.
// fn: The function to execute. Must return (result, error).
Step(name string, fn func() (interface{}, error), opts ...StepOption) StepResult
}
Context wraps standard context and adds durable execution capabilities.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine manages the durable execution.
type ResultContainer ¶
type ResultContainer struct {
Value interface{}
Err error
}
ResultContainer is a helper to unmarshal step results.
type StepConfig ¶
type StepConfig struct {
MaxRetries int
}
type StepOption ¶
type StepOption func(*StepConfig)
StepOption allows configuring a step (e.g., retries).
func Retry ¶
func Retry(times int) StepOption
type StepResult ¶
type StepResult interface {
// Result unmarshals the success value into target (pointer).
Result(target interface{}) error
// Err returns the error if the step failed.
Err() error
}
StepResult allows retrieving the result of a step or its error.
type WorkflowFunc ¶
WorkflowFunc is the function signature for a workflow.
Click to show internal directories.
Click to hide internal directories.