Documentation ¶
Index ¶
- Constants
- type Orchestrator
- type Saga
- type SagaContext
- type SagaRepository
- type SagaStep
- type SagaStore
- type StepActionFunc
- type StepOption
- func OnActionReply[T any](replyName string, fn StepReplyHandlerFunc[T]) StepOption[T]
- func OnCompensationReply[T any](replyName string, fn StepReplyHandlerFunc[T]) StepOption[T]
- func WithAction[T any](fn StepActionFunc[T]) StepOption[T]
- func WithCompensation[T any](fn StepActionFunc[T]) StepOption[T]
- type StepReplyHandlerFunc
Constants ¶
View Source
const ( SagaCommandIDHdr = am.CommandHdrPrefix + "SAGA_ID" SagaCommandNameHdr = am.CommandHdrPrefix + "SAGA_NAME" SagaReplyIDHdr = am.ReplyHdrPrefix + "SAGA_ID" SagaReplyNameHdr = am.ReplyHdrPrefix + "SAGA_NAME" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Orchestrator ¶
type Orchestrator[T any] interface { Start(ctx context.Context, id string, data T) error ReplyTopic() string HandleReply(ctx context.Context, reply ddd.Reply) error }
func NewOrchestrator ¶
func NewOrchestrator[T any](saga Saga[T], repo SagaRepository[T], publisher am.CommandPublisher) Orchestrator[T]
type Saga ¶
type SagaContext ¶
type SagaRepository ¶
type SagaRepository[T any] struct { // contains filtered or unexported fields }
func NewSagaRepository ¶
func NewSagaRepository[T any](reg registry.Registry, store SagaStore) SagaRepository[T]
func (SagaRepository[T]) Load ¶
func (r SagaRepository[T]) Load(ctx context.Context, sagaName, sagaID string) (*SagaContext[T], error)
func (SagaRepository[T]) Save ¶
func (r SagaRepository[T]) Save(ctx context.Context, sagaName string, sagaCtx *SagaContext[T]) error
type SagaStep ¶
type SagaStep[T any] interface { Action(fn StepActionFunc[T]) SagaStep[T] Compensation(fn StepActionFunc[T]) SagaStep[T] OnActionReply(replyName string, fn StepReplyHandlerFunc[T]) SagaStep[T] OnCompensationReply(replyName string, fn StepReplyHandlerFunc[T]) SagaStep[T] // contains filtered or unexported methods }
type StepOption ¶
type StepOption[T any] func(step *sagaStep[T])
func OnActionReply ¶
func OnActionReply[T any](replyName string, fn StepReplyHandlerFunc[T]) StepOption[T]
func OnCompensationReply ¶
func OnCompensationReply[T any](replyName string, fn StepReplyHandlerFunc[T]) StepOption[T]
func WithAction ¶
func WithAction[T any](fn StepActionFunc[T]) StepOption[T]
func WithCompensation ¶
func WithCompensation[T any](fn StepActionFunc[T]) StepOption[T]
Click to show internal directories.
Click to hide internal directories.