Versions in this module Expand all Collapse all v1 v1.0.0 Sep 18, 2019 v0 v0.0.2 Feb 15, 2019 v0.0.1 Feb 4, 2019 Changes in this version + 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 NullTime struct + Time time.Time + Valid bool + func (nt *NullTime) Scan(value interface{}) error + func (nt NullTime) Value() (driver.Value, error) + type Option func(*Outboxer) + func WithCheckInterval(t time.Duration) Option + func WithCleanUpBatchSize(s int32) Option + func WithCleanUpBefore(t time.Time) 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 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()