Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConfigNotSet = errors.New("config not set") ErrClientNotSet = errors.New("client not set") ErrSagasNotSet = errors.New("sagas not set") ErrLoggerNotSet = errors.New("logger not set") ErrRetryPolicyNotSet = errors.New("retry policy not set") ErrActionActivityNotSet = errors.New("action activity not set") ErrCompensationActivityNotSet = errors.New("compensation activity not set") ErrActivityOptionsNotSet = errors.New("activity options not set") ErrIdentifierNotSet = errors.New("identifier not set") ErrSagaWorkflowNotFound = errors.New("saga workflow not found") ErrStartWorkflowOptionsNotSet = errors.New("start workflow options not set") ErrInputNotSet = errors.New("input not set") )
Functions ¶
This section is empty.
Types ¶
type ExecuteSagaParams ¶
type ExecuteSagaParams struct { Identifier string Options *client.StartWorkflowOptions Input []interface{} }
type ExecuteSagaResult ¶
type SagaClient ¶
type SagaClient struct { Client client.Client RegisteredSagas map[string]WorkflowFunc Logger *zap.Logger }
func NewSagaClient ¶
func NewSagaClient(options ...SagaClientOption) (*SagaClient, error)
func (*SagaClient) Execute ¶
func (c *SagaClient) Execute(ctx context.Context, param *ExecuteSagaParams) (*ExecuteSagaResult, error)
type SagaClientOption ¶
type SagaClientOption func(*SagaClient)
func WithClient ¶
func WithClient(client client.Client) SagaClientOption
func WithLogger ¶
func WithLogger(logger *zap.Logger) SagaClientOption
func WithSagaCustomWorkflows ¶
func WithSagaCustomWorkflows(sagaWf ...SagaWorkflow) SagaClientOption
type SagaWorkflow ¶
type SagaWorkflow struct { ActionActivity SagaActivityFunc CompensationActivity SagaActivityFunc Options *workflow.ActivityOptions Identifier string }
func NewSagaWorkflow ¶
func NewSagaWorkflow(options ...SagaWorkflowOption) (*SagaWorkflow, error)
NewSagaWorkflow creates a new SagaWorkflow.
type SagaWorkflowOption ¶
type SagaWorkflowOption func(*SagaWorkflow)
SagaWorkflowOption defines the signature for functions that can configure SagaWorkflow
func WithActionActivity ¶
func WithActionActivity(activityFunc SagaActivityFunc) SagaWorkflowOption
WithActionActivity configures the action activity and its options.
func WithActivityOptions ¶
func WithActivityOptions(options workflow.ActivityOptions) SagaWorkflowOption
WithActivityOptions configures the activity options.
func WithCompensationActivity ¶
func WithCompensationActivity(activityFunc SagaActivityFunc) SagaWorkflowOption
WithCompensationActivity configures the compensation activity and its options.
func WithIdentifier ¶
func WithIdentifier(identifier string) SagaWorkflowOption
WithIdentifier configures the identifier.
type WorkflowFunc ¶
Click to show internal directories.
Click to hide internal directories.