Documentation
¶
Index ¶
- type Config
- type ExecutionManager
- func (em *ExecutionManager) AddProgressEvent(runID string, event pkgEvents.ExecutionEvent)
- func (em *ExecutionManager) CanStartExecution() bool
- func (em *ExecutionManager) FinishExecution(runID string, outputs map[string]any, err error)
- func (em *ExecutionManager) GetActiveExecutions() int
- func (em *ExecutionManager) GetExecution(runID string) (*ExecutionStatus, bool)
- func (em *ExecutionManager) StartExecution(runID, workflowID string, cancel context.CancelFunc, inputs map[string]any) *ExecutionStatus
- func (em *ExecutionManager) StartListening(progressChan <-chan pkgEvents.ExecutionEvent)
- func (em *ExecutionManager) StopListening()
- type ExecutionStatus
- type Server
- type WorkflowRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Host string
Port int
Concurrency int
Timeout time.Duration
EnableMetrics bool
EnableCORS bool
WorkflowFiles []string
WorkflowDir string
ReadTimeout time.Duration
WriteTimeout time.Duration
IdleTimeout time.Duration
ShutdownTimeout time.Duration
}
Config holds the server configuration
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a default server configuration
type ExecutionManager ¶
type ExecutionManager struct {
// contains filtered or unexported fields
}
ExecutionManager handles concurrent workflow executions
func NewExecutionManager ¶
func NewExecutionManager(maxConcurrency int) *ExecutionManager
NewExecutionManager creates a new execution manager
func NewExecutionManagerWithRegistry ¶
func NewExecutionManagerWithRegistry(maxConcurrency int, registerer prometheus.Registerer) *ExecutionManager
NewExecutionManagerWithRegistry creates a new execution manager with a custom registry
func (*ExecutionManager) AddProgressEvent ¶
func (em *ExecutionManager) AddProgressEvent(runID string, event pkgEvents.ExecutionEvent)
AddProgressEvent adds a progress event to an execution
func (*ExecutionManager) CanStartExecution ¶
func (em *ExecutionManager) CanStartExecution() bool
CanStartExecution checks if a new execution can be started
func (*ExecutionManager) FinishExecution ¶
func (em *ExecutionManager) FinishExecution(runID string, outputs map[string]any, err error)
FinishExecution marks an execution as finished
func (*ExecutionManager) GetActiveExecutions ¶
func (em *ExecutionManager) GetActiveExecutions() int
GetActiveExecutions returns the number of active executions
func (*ExecutionManager) GetExecution ¶
func (em *ExecutionManager) GetExecution(runID string) (*ExecutionStatus, bool)
GetExecution retrieves an execution status
func (*ExecutionManager) StartExecution ¶
func (em *ExecutionManager) StartExecution(runID, workflowID string, cancel context.CancelFunc, inputs map[string]any) *ExecutionStatus
StartExecution starts tracking a new execution
func (*ExecutionManager) StartListening ¶
func (em *ExecutionManager) StartListening(progressChan <-chan pkgEvents.ExecutionEvent)
func (*ExecutionManager) StopListening ¶
func (em *ExecutionManager) StopListening()
type ExecutionStatus ¶
type ExecutionStatus struct {
RunID string `json:"run_id"`
WorkflowID string `json:"workflow_id"`
Status string `json:"status"`
StartTime time.Time `json:"start_time"`
EndTime *time.Time `json:"end_time,omitempty"`
Duration time.Duration `json:"duration"`
Inputs map[string]any `json:"inputs"`
Outputs map[string]any `json:"outputs,omitempty"`
Error string `json:"error,omitempty"`
Progress []pkgEvents.ExecutionEvent `json:"progress,omitempty"`
// contains filtered or unexported fields
}
ExecutionStatus represents the status of a workflow execution
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the Lacquer HTTP server
func (*Server) GetWorkflowCount ¶
GetWorkflowCount returns the number of loaded workflows
func (*Server) LoadWorkflows ¶
LoadWorkflows loads and validates workflows from the configuration
func (*Server) StartWithGracefulShutdown ¶
StartWithGracefulShutdown starts the server and handles graceful shutdown
type WorkflowRegistry ¶
type WorkflowRegistry struct {
// contains filtered or unexported fields
}
WorkflowRegistry holds validated workflows
func NewWorkflowRegistry ¶
func NewWorkflowRegistry() *WorkflowRegistry
NewWorkflowRegistry creates a new workflow registry
func (*WorkflowRegistry) Count ¶
func (r *WorkflowRegistry) Count() int
Count returns the number of registered workflows
func (*WorkflowRegistry) Get ¶
func (r *WorkflowRegistry) Get(id string) (*ast.Workflow, bool)
Get retrieves a workflow by ID
func (*WorkflowRegistry) List ¶
func (r *WorkflowRegistry) List() []string
List returns all workflow IDs