Documentation
¶
Index ¶
- type Engine
- type ModuleFactory
- type StartStopModule
- type StdEngine
- func (e *StdEngine) AddModuleType(moduleType string, factory ModuleFactory)
- func (e *StdEngine) BuildFromConfig(cfg *config.WorkflowConfig) error
- func (e *StdEngine) RegisterTrigger(trigger module.Trigger)
- func (e *StdEngine) RegisterWorkflowHandler(handler WorkflowHandler)
- func (e *StdEngine) Start(ctx context.Context) error
- func (e *StdEngine) Stop(ctx context.Context) error
- func (e *StdEngine) TriggerWorkflow(ctx context.Context, workflowType string, action string, ...) error
- type WorkflowHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine interface {
RegisterWorkflowHandler(handler WorkflowHandler)
RegisterTrigger(trigger module.Trigger)
AddModuleType(moduleType string, factory ModuleFactory)
BuildFromConfig(cfg *config.WorkflowConfig) error
Start(ctx context.Context) error
Stop(ctx context.Context) error
TriggerWorkflow(ctx context.Context, workflowType string, action string, data map[string]interface{}) error
}
type ModuleFactory ¶
ModuleFactory is a function that creates a module from a name and configuration
type StartStopModule ¶
type StartStopModule interface {
modular.Module
Start(ctx context.Context) error
Stop(ctx context.Context) error
}
StartStopModule extends the basic Module interface with lifecycle methods
type StdEngine ¶
type StdEngine struct {
// contains filtered or unexported fields
}
StdEngine represents the workflow execution engine
func NewStdEngine ¶
func NewStdEngine(app modular.Application, logger modular.Logger) *StdEngine
NewStdEngine creates a new workflow engine
func (*StdEngine) AddModuleType ¶
func (e *StdEngine) AddModuleType(moduleType string, factory ModuleFactory)
AddModuleType registers a factory function for a module type
func (*StdEngine) BuildFromConfig ¶
func (e *StdEngine) BuildFromConfig(cfg *config.WorkflowConfig) error
BuildFromConfig builds a workflow from configuration
func (*StdEngine) RegisterTrigger ¶
RegisterTrigger registers a trigger with the engine
func (*StdEngine) RegisterWorkflowHandler ¶
func (e *StdEngine) RegisterWorkflowHandler(handler WorkflowHandler)
RegisterWorkflowHandler adds a workflow handler to the engine
type WorkflowHandler ¶
type WorkflowHandler interface {
// CanHandle returns true if this handler can process the given workflow type
CanHandle(workflowType string) bool
// ConfigureWorkflow sets up the workflow from configuration
ConfigureWorkflow(app modular.Application, workflowConfig interface{}) error
// ExecuteWorkflow executes a workflow with the given action and input data
ExecuteWorkflow(ctx context.Context, workflowType string, action string, data map[string]interface{}) (map[string]interface{}, error)
}
WorkflowHandler interface for handling different workflow types
Directories
¶
| Path | Synopsis |
|---|---|
|
Package handlers provides workflow handling capabilities
|
Package handlers provides workflow handling capabilities |
|
Package mock provides common mock implementations for testing
|
Package mock provides common mock implementations for testing |
|
Package module defines core interfaces for the workflow engine
|
Package module defines core interfaces for the workflow engine |
Click to show internal directories.
Click to hide internal directories.