Documentation
¶
Index ¶
- func NewChildWorkflowActivity(executor workflow.ChildWorkflowExecutor) workflow.Activity
- func NewFailActivity() workflow.Activity
- func NewJSONActivity() workflow.Activity
- func NewPrintActivity() workflow.Activity
- func NewPrintActivityTo(w io.Writer) workflow.Activity
- func NewRandomActivity() workflow.Activity
- func NewTimeActivity() workflow.Activity
- type ChildWorkflowActivity
- type ChildWorkflowInput
- type FailActivity
- type FailInput
- type FailOutput
- type JSONActivity
- type JSONInput
- type PrintActivity
- type PrintInput
- type RandomActivity
- type RandomInput
- type TimeActivity
- type TimeInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewChildWorkflowActivity ¶
func NewChildWorkflowActivity(executor workflow.ChildWorkflowExecutor) workflow.Activity
NewChildWorkflowActivity creates a new ChildWorkflowActivity that can be used to execute child workflows
func NewFailActivity ¶
func NewJSONActivity ¶
func NewPrintActivity ¶
NewPrintActivity returns a print activity that writes to os.Stdout.
func NewPrintActivityTo ¶ added in v0.0.2
NewPrintActivityTo returns a print activity that writes to w. If w is nil, os.Stdout is used.
func NewRandomActivity ¶
func NewTimeActivity ¶
Types ¶
type ChildWorkflowActivity ¶
type ChildWorkflowActivity struct {
// contains filtered or unexported fields
}
ChildWorkflowActivity executes a registered child workflow synchronously.
func (*ChildWorkflowActivity) Execute ¶
func (c *ChildWorkflowActivity) Execute(ctx workflow.Context, params ChildWorkflowInput) (map[string]any, error)
Execute runs the child workflow activity
func (*ChildWorkflowActivity) Name ¶
func (c *ChildWorkflowActivity) Name() string
Name returns the activity name
type ChildWorkflowInput ¶
type ChildWorkflowInput struct {
WorkflowName string `json:"workflow_name"`
Inputs map[string]interface{} `json:"inputs"`
Timeout time.Duration `json:"timeout"`
ParentID string `json:"parent_id"`
}
ChildWorkflowInput defines the input parameters for the child workflow activity.
The activity always runs the child synchronously: the parent step blocks until the child completes (or times out) and the result is stored under Step.Store. Workflows that need fire-and-forget behavior should call ChildWorkflowExecutor.ExecuteAsync directly from a custom activity.
type FailActivity ¶
type FailActivity struct{}
FailActivity can be used to fail the workflow
func (*FailActivity) Execute ¶
func (a *FailActivity) Execute(ctx workflow.Context, params FailInput) (FailOutput, error)
func (*FailActivity) Name ¶
func (a *FailActivity) Name() string
type FailInput ¶
type FailInput struct {
Message string `json:"message"`
}
FailInput defines the input parameters for the fail activity
type JSONActivity ¶
type JSONActivity struct{}
JSONActivity can be used to work with JSON data
func (*JSONActivity) Name ¶
func (a *JSONActivity) Name() string
type JSONInput ¶
type JSONInput struct {
Operation string `json:"operation"` // parse, stringify, query, merge, validate
Data string `json:"data"` // JSON string to work with
Query string `json:"query"` // JSONPath-like query (simplified)
MergeWith string `json:"merge_with"` // JSON string to merge with
}
JSONInput defines the input parameters for the JSON activity
type PrintActivity ¶
type PrintActivity struct {
// contains filtered or unexported fields
}
PrintActivity prints a formatted message to a configurable writer. The default writer is os.Stdout; tests and embedded use cases can pass a different writer via NewPrintActivityTo.
func (*PrintActivity) Execute ¶
func (a *PrintActivity) Execute(ctx workflow.Context, params PrintInput) (string, error)
func (*PrintActivity) Name ¶
func (a *PrintActivity) Name() string
type PrintInput ¶
PrintInput defines the input parameters for the print activity
type RandomActivity ¶
type RandomActivity struct{}
RandomActivity can be used to generate random values
func (*RandomActivity) Execute ¶
func (a *RandomActivity) Execute(ctx workflow.Context, params RandomInput) (any, error)
func (*RandomActivity) Name ¶
func (a *RandomActivity) Name() string
type RandomInput ¶
type RandomInput struct {
Type string `json:"type"` // uuid, number, string, choice, boolean
Min float64 `json:"min"` // minimum value for number generation
Max float64 `json:"max"` // maximum value for number generation
Length int `json:"length"` // length for string generation
Choices []string `json:"choices"` // choices for selection
Count int `json:"count"` // number of items to generate
Charset string `json:"charset"` // character set for string generation
Seed int64 `json:"seed"` // seed for reproducible randomness
}
RandomInput defines the input parameters for the random activity
type TimeActivity ¶
type TimeActivity struct{}
TimeActivity can be used to get the current time
func (*TimeActivity) Name ¶
func (a *TimeActivity) Name() string