Versions in this module Expand all Collapse all v1 v1.1.0 Oct 24, 2023 v1.0.0 Oct 9, 2023 Changes in this version + var ErrInvalidDB = fmt.Errorf("invalid db") + var ErrNoTransaction = fmt.Errorf("no transaction") + var ErrServiceNotCreate = fmt.Errorf("service not create") + type CustomRetry struct + Intervals []time.Duration + func (c *CustomRetry) Next(info *RetryInfo) *RetryInfo + type EventBus struct + func NewEventBus(serviceName string, db *gorm.DB, options ...Option) *EventBus + func (e *EventBus) Commit(ctx context.Context) error + func (e *EventBus) Dispatch(ctx context.Context, events ...*dddfirework.DomainEvent) error + func (e *EventBus) DispatchBegin(ctx context.Context, evts ...*dddfirework.DomainEvent) (context.Context, error) + func (e *EventBus) Options() []dddfirework.Option + func (e *EventBus) RegisterEventHandler(cb dddfirework.DomainEventHandler) + func (e *EventBus) RegisterEventTXChecker(checker dddfirework.DomainEventTXChecker) + func (e *EventBus) Rollback(ctx context.Context) error + func (e *EventBus) Start(ctx context.Context) + type EventPO struct + CreatedAt time.Time + Event *dddfirework.DomainEvent + EventCreatedAt time.Time + EventID string + ID int64 + TransID int64 + func (o *EventPO) TableName() string + type EventStatus int8 + const EventStatusFailed + const EventStatusSent + const EventStatusToSend + type FailedInfo struct + IDs []string + Retry int + type IRetryStrategy interface + Next func(info *RetryInfo) *RetryInfo + type IntervalRetry struct + Interval time.Duration + Limit int + func (c *IntervalRetry) Next(info *RetryInfo) *RetryInfo + type LimitRetry struct + Limit int + func (c *LimitRetry) Next(info *RetryInfo) *RetryInfo + type Option func(opt *Options) + type Options struct + CleanCron string + ConsumeConcurrent int + CustomRetry []time.Duration + DefaultOffset *int64 + LimitPerRun int + RetentionTime time.Duration + RetryInterval time.Duration + RetryLimit int + RetryStrategy IRetryStrategy + RunInterval time.Duration + TXCheckTimeout time.Duration + type RetryInfo struct + ID int64 + RetryCount int + RetryTime time.Time + type ServicePO struct + CreatedAt time.Time + Failed []*RetryInfo + Name string + Offset int64 + Retry []*RetryInfo + UpdatedAt time.Time + func (o *ServicePO) GetID() string + func (o *ServicePO) TableName() string + type Transaction struct + CreatedAt time.Time + DueTime time.Time + Events []*dddfirework.DomainEvent + ID int64 + Service string + func (o *Transaction) TableName() string