Documentation
¶
Index ¶
- Variables
- func DefaultHTTPDispatcher(ctx context.Context, url string, taskID string, payload map[string]any) error
- type APICallConfig
- type APICallPlugin
- type Dispatcher
- type ExternalReviewConfig
- type ExternalReviewPlugin
- type PaymentConfig
- type PaymentPlugin
- type PluginContext
- type Registry
- type TaskPlugin
- type UserInputConfig
- type UserInputPlugin
Constants ¶
This section is empty.
Variables ¶
var ErrSuspended = errors.New("activity result pending")
ErrSuspended is returned by a plugin when it wants to pause task execution and wait for an asynchronous action.
Functions ¶
Types ¶
type APICallConfig ¶
type APICallConfig struct {
URL string `json:"url"`
}
APICallConfig holds properties decoded from the TaskTemplate's JSON configuration.
type APICallPlugin ¶
type APICallPlugin struct {
// contains filtered or unexported fields
}
APICallPlugin implements the generic_api_call plugin for FIRE_AND_FORGET tasks. It sends an API request to a configured URL containing the task data payload.
func (*APICallPlugin) Execute ¶
func (p *APICallPlugin) Execute(ctx PluginContext, configRaw json.RawMessage) error
type Dispatcher ¶
Dispatcher defines the function signature for executing external system integrations.
type ExternalReviewConfig ¶
type ExternalReviewConfig struct {
ExternalURL string `json:"external_url"`
}
ExternalReviewConfig holds properties decoded from the TaskTemplate's JSON configuration.
type ExternalReviewPlugin ¶
type ExternalReviewPlugin struct {
// contains filtered or unexported fields
}
ExternalReviewPlugin manages asynchronous delegation of task steps to third-party government agencies.
func (*ExternalReviewPlugin) Execute ¶
func (p *ExternalReviewPlugin) Execute(ctx PluginContext, configRaw json.RawMessage) error
type PaymentConfig ¶
type PaymentConfig struct {
PaymentServiceURL string `json:"payment_service_url"`
}
PaymentConfig holds properties decoded from the TaskTemplate's JSON configuration.
type PaymentPlugin ¶
type PaymentPlugin struct {
// contains filtered or unexported fields
}
PaymentPlugin implements the generic_payment plugin. It initiates a payment step externally and transitions the task record to "PENDING_PAYMENT".
func (*PaymentPlugin) Execute ¶
func (p *PaymentPlugin) Execute(ctx PluginContext, configRaw json.RawMessage) error
type PluginContext ¶
type PluginContext struct {
Context context.Context
Record *store.TaskRecord
Inputs map[string]any
OutputNamespace string
}
PluginContext provides the database record, input arguments, and context to a plugin during execution.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a thread-safe registry of task plugins keyed by taskType and pluginName.
type TaskPlugin ¶
type TaskPlugin interface {
// Execute runs the custom logic of the plugin, updating the task record status and metadata.
// The config argument contains the custom plugin configuration parameters unmarshaled from JSON.
Execute(ctx PluginContext, config json.RawMessage) error
}
TaskPlugin is the interface that all interaction and system action handlers must implement.
func NewAPICallPlugin ¶
func NewAPICallPlugin(dispatcher Dispatcher) TaskPlugin
NewAPICallPlugin creates a new APICallPlugin.
func NewExternalReviewPlugin ¶
func NewExternalReviewPlugin(dispatcher Dispatcher) TaskPlugin
NewExternalReviewPlugin returns a plugin with a custom or default HTTP dispatcher.
func NewPaymentPlugin ¶
func NewPaymentPlugin(dispatcher Dispatcher) TaskPlugin
NewPaymentPlugin creates a new PaymentPlugin.
func NewUserInputPlugin ¶
func NewUserInputPlugin() TaskPlugin
type UserInputConfig ¶
type UserInputConfig struct {
StatusOverride string `json:"status_override,omitempty"`
}
UserInputConfig holds properties specific to the user input step
type UserInputPlugin ¶
type UserInputPlugin struct{}
UserInputPlugin implements a standard human interaction / form submission step.
func (*UserInputPlugin) Execute ¶
func (p *UserInputPlugin) Execute(ctx PluginContext, configRaw json.RawMessage) error