Documentation ¶
Index ¶
- func Cron(c string) cron
- func Crons(c ...string) cronArr
- func Event(e string) event
- func Events(events ...string) eventsArr
- type Action
- type Service
- type Worker
- type WorkerOpt
- type WorkerOpts
- type Workflow
- type WorkflowJob
- type WorkflowStep
- func (s *WorkflowStep) GetActionId(svcName string, index int) string
- func (s *WorkflowStep) GetStepId(index int) string
- func (w WorkflowStep) SetName(name string) WorkflowStep
- func (w WorkflowStep) SetTimeout(timeout string) WorkflowStep
- func (w WorkflowStep) ToActionMap(svcName string) map[string]any
- func (w WorkflowStep) ToWorkflow(svcName string) types.Workflow
- func (s *WorkflowStep) ToWorkflowStep(prevStep *step, svcName string, index int) (*step, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action interface { // Name returns the name of the action Name() string // Run runs the action Run(args ...any) []any MethodFn() any }
Action is an individual action that can be run by the worker.
type Service ¶
type Service struct { Name string // contains filtered or unexported fields }
func (*Service) RegisterAction ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) NewService ¶
type WorkerOpt ¶
type WorkerOpt func(*WorkerOpts)
func WithClient ¶
func WithErrorAlerter ¶
func WithIntegration ¶
func WithIntegration(integration integrations.Integration) WorkerOpt
type WorkerOpts ¶
type WorkerOpts struct {
// contains filtered or unexported fields
}
type Workflow ¶
type Workflow struct {
Jobs []WorkflowJob
}
type WorkflowJob ¶
type WorkflowJob struct { // The name of the job Name string Description string Timeout string // The steps that are run in the job Steps []WorkflowStep }
func (*WorkflowJob) ToActionMap ¶
func (j *WorkflowJob) ToActionMap(svcName string) map[string]any
func (*WorkflowJob) ToWorkflow ¶
func (j *WorkflowJob) ToWorkflow(svcName string) types.Workflow
func (*WorkflowJob) ToWorkflowJob ¶
func (j *WorkflowJob) ToWorkflowJob(svcName string) (*types.WorkflowJob, error)
type WorkflowStep ¶
type WorkflowStep struct { // The step timeout Timeout string // The executed function Function any // The step id/name. If not set, one will be generated from the function name Name string }
func Fn ¶
func Fn(f any) WorkflowStep
func (*WorkflowStep) GetActionId ¶
func (s *WorkflowStep) GetActionId(svcName string, index int) string
func (*WorkflowStep) GetStepId ¶
func (s *WorkflowStep) GetStepId(index int) string
func (WorkflowStep) SetName ¶
func (w WorkflowStep) SetName(name string) WorkflowStep
func (WorkflowStep) SetTimeout ¶
func (w WorkflowStep) SetTimeout(timeout string) WorkflowStep
func (WorkflowStep) ToActionMap ¶
func (w WorkflowStep) ToActionMap(svcName string) map[string]any
func (WorkflowStep) ToWorkflow ¶
func (w WorkflowStep) ToWorkflow(svcName string) types.Workflow
func (*WorkflowStep) ToWorkflowStep ¶
func (s *WorkflowStep) ToWorkflowStep(prevStep *step, svcName string, index int) (*step, error)
Click to show internal directories.
Click to hide internal directories.