Versions in this module Expand all Collapse all v1 v1.1.1 May 25, 2022 Changes in this version + var ErrFailedToDecodeType = errors.New("could not decode type") + var ErrMissingDataStore = errors.New("a data store is required for the outboxer to work") + var ErrMissingEventStream = errors.New("an event stream is required for the outboxer to work") + type DataStore interface + Add func(ctx context.Context, m *OutboxMessage) error + AddWithinTx func(ctx context.Context, m *OutboxMessage, fn func(ExecerContext) error) error + GetEvents func(ctx context.Context, batchSize int32) ([]*OutboxMessage, error) + Remove func(ctx context.Context, since time.Time, batchSize int32) error + SetAsDispatched func(ctx context.Context, id int64) error + type DynamicValues map[string]interface + func (p *DynamicValues) Scan(src interface{}) error + func (p DynamicValues) Value() (driver.Value, error) + type EventStream interface + Send func(context.Context, *OutboxMessage) error + type ExecerContext interface + ExecContext func(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + type Option func(*Outboxer) + func WithCheckInterval(t time.Duration) Option + func WithCleanUpBatchSize(s int32) Option + func WithCleanUpOlderThan(t time.Duration) Option + func WithCleanupInterval(t time.Duration) Option + func WithDataStore(ds DataStore) Option + func WithEventStream(es EventStream) Option + func WithMessageBatchSize(s int32) Option + type OutboxMessage struct + Dispatched bool + DispatchedAt sql.NullTime + Headers DynamicValues + ID int64 + Options DynamicValues + Payload []byte + type Outboxer struct + func New(opts ...Option) (*Outboxer, error) + func (o *Outboxer) ErrChan() <-chan error + func (o *Outboxer) OkChan() <-chan struct{} + func (o *Outboxer) Send(ctx context.Context, m *OutboxMessage) error + func (o *Outboxer) SendWithinTx(ctx context.Context, evt *OutboxMessage, fn func(ExecerContext) error) error + func (o *Outboxer) Start(ctx context.Context) + func (o *Outboxer) StartCleanup(ctx context.Context) + func (o *Outboxer) StartDispatcher(ctx context.Context) + func (o *Outboxer) Stop()