Documentation
¶
Index ¶
- Variables
- type Config
- type Option
- func WithApprovalService(svc approval.Service) Option
- func WithEventService(service *event.Service) Option
- func WithExecutorOptions(opts ...executor.Option) Option
- func WithExtensionServices(services ...types.Service) Option
- func WithExtensionTypes(types ...*x.Type) Option
- func WithMetaBaseURL(url string) Option
- func WithMetaFsOptions(options ...storage.Option) Option
- func WithMetaService(service *meta.Service) Option
- func WithProcessDAO(dao dao.Service[string, execution.Process]) Option
- func WithProcessorWorkers(count int) Option
- func WithQueue(queue messaging.Queue[execution.Execution]) Option
- func WithRootTaskNodeName(name string) Option
- func WithStateListeners(listeners ...execution.StateListener) Option
- func WithTaskExecutionDAO(dao dao.Service[string, execution.Execution]) Option
- func WithTracing(serviceName, serviceVersion, outputFile string) Option
- func WithTracingExporter(serviceName, serviceVersion string, exporter sdktrace.SpanExporter) Option
- func WithWhenListeners(listeners ...execution.WhenListener) Option
- type ProcessorConfig
- type Runtime
- func (r *Runtime) DecodeYAMLWorkflow(data []byte) (*model.Workflow, error)
- func (r *Runtime) Execution(ctx context.Context, id string) (*execution.Execution, error)
- func (r *Runtime) LoadWorkflow(ctx context.Context, location string) (*model.Workflow, error)
- func (r *Runtime) Process(ctx context.Context, id string) (*execution.Process, error)
- func (r *Runtime) Processes(ctx context.Context, parameter ...*dao.Parameter) ([]*execution.Process, error)
- func (r *Runtime) SaveExecution(ctx context.Context, anExecution *execution.Execution) error
- func (r *Runtime) Shutdown(ctx context.Context) error
- func (r *Runtime) Start(ctx context.Context) error
- func (r *Runtime) StartProcess(ctx context.Context, aWorkflow *model.Workflow, ...) (*execution.Process, execution.Wait, error)
- type Service
- func (s *Service) Actions() *extension.Actions
- func (s *Service) ApprovalService() approval.Service
- func (s *Service) EventService() *event.Service
- func (s *Service) NewContext(ctx context.Context) context.Context
- func (s *Service) RegisterExtensionServices(services ...types.Service)
- func (s *Service) RegisterExtensionType(aType *x.Type)
- func (s *Service) RegisterExtensionTypes(types ...*x.Type)
- func (s *Service) Runtime() *Runtime
Constants ¶
This section is empty.
Variables ¶
var ( ErrTaskNotFound = errors.New("task not found in workflow") ErrMethodNotFound = errors.New("method not found in service") )
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.1.1
type Config struct {
Processor ProcessorConfig `json:"processor" yaml:"processor"`
}
func DefaultConfig ¶ added in v0.1.1
func DefaultConfig() *Config
DefaultConfig returns a Config populated with exactly the same default values that were previously hard-coded in the constructors. Callers may modify the returned struct before passing it to NewFromConfig.
type Option ¶
type Option func(s *Service)
Service represents fluxor service
func WithApprovalService ¶ added in v0.1.1
WithApprovalService sets the approvalService service
func WithEventService ¶
func WithExecutorOptions ¶ added in v0.1.1
WithExecutorOptions lets the caller supply additional options passed to executor.NewService (e.g. disabling the default StdoutListener).
func WithExtensionServices ¶
WithExtensionServices sets the extension services
func WithExtensionTypes ¶
WithExtensionTypes sets the extension types
func WithMetaBaseURL ¶
WithMetaBaseURL sets the meta base URL
func WithMetaFsOptions ¶
WithMetaFsOptions with meta file system options
func WithMetaService ¶
WithMetaService sets the meta service
func WithProcessDAO ¶
WithProcessDAO sets the processor DAO
func WithProcessorWorkers ¶
WithProcessorWorkers sets the processor workers
func WithRootTaskNodeName ¶
WithRootTaskNodeName sets the root task node name
func WithStateListeners ¶ added in v0.1.2
func WithStateListeners(listeners ...execution.StateListener) Option
func WithTaskExecutionDAO ¶
WithTaskExecutionDAO sets the task execution DAO
func WithTracing ¶
WithTracing configures OpenTelemetry tracing for the service. If outputFile is empty the stdout exporter is used; otherwise traces are written to the supplied file path. The function is safe to call multiple times – the first successful initialisation wins.
func WithTracingExporter ¶
func WithTracingExporter(serviceName, serviceVersion string, exporter sdktrace.SpanExporter) Option
WithTracingExporter configures OpenTelemetry tracing using a custom SpanExporter. This enables integrations with exporters other than the built-in stdout exporter, for example OTLP, Jaeger or Zipkin. The function is safe to call multiple times – the first successful initialisation wins.
func WithWhenListeners ¶ added in v0.1.2
func WithWhenListeners(listeners ...execution.WhenListener) Option
WithWhenListeners registers callbacks invoked after every when-condition evaluation.
type ProcessorConfig ¶ added in v0.1.1
type ProcessorConfig struct {
WorkerCount int `json:"workers" yaml:"workers"`
}
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime represents a workflow engine runtime
func (*Runtime) DecodeYAMLWorkflow ¶
DecideYAMLWorkflow loads a workflow
func (*Runtime) LoadWorkflow ¶
LoadWorkflow loads a workflow
func (*Runtime) Processes ¶
func (r *Runtime) Processes(ctx context.Context, parameter ...*dao.Parameter) ([]*execution.Process, error)
Processes returns a list of processes
func (*Runtime) SaveExecution ¶
Processes saves execution
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewFromConfig ¶ added in v0.1.1
NewFromConfig constructs the Fluxor engine using a declarative configuration that can be further customised by functional options. The precedence order is:
- package defaults (via DefaultConfig)
- values present in cfg (may be nil – treated as empty)
- values set by Option functions (highest priority)
func (*Service) ApprovalService ¶ added in v0.1.1
func (*Service) EventService ¶
EventService returns event service