Versions in this module Expand all Collapse all v0 v0.1.1 Nov 10, 2026 v0.1.0 Nov 10, 2026 Changes in this version + const MigrationOwner + var ErrSchemaTooNew = errors.New("outbox: the database schema is newer than this code") + func DefaultIDGenerator() (string, error) + type DeadEntry struct + Attempts int + CreatedAt time.Time + ID string + Job workflow.Job + LastErr string + type DeadFunc func(ctx context.Context, e DeadEntry, cause error) + type DeadQuery struct + After string + Limit int + Workflow string + type IDGenerator func() (string, error) + type MigrationScript struct + Name string + Owner string + Statements []string + func MigrationScripts(d sqlb.Dialect, opts ...Option) ([]MigrationScript, error) + type Option func(*Outbox) + func WithClock(c clock.Clock) Option + func WithIDGenerator(g IDGenerator) Option + func WithLogger(l *slog.Logger) Option + func WithSchema(name string) Option + func WithTablePrefix(p string) Option + type Outbox struct + func New(db *sql.DB, d sqlb.Dialect, opts ...Option) (*Outbox, error) + func (o *Outbox) ListDead(ctx context.Context, q DeadQuery) ([]DeadEntry, error) + func (o *Outbox) Migrate(ctx context.Context) error + func (o *Outbox) NewRelay(target workflow.Client, opts ...RelayOption) (*Relay, error) + func (o *Outbox) Requeue(ctx context.Context, id string) error + func (o *Outbox) Write(ctx context.Context, tx *sql.Tx, job workflow.Job) (string, error) + type Relay struct + func (r *Relay) Flush(ctx context.Context) (int, error) + func (r *Relay) Notify() + func (r *Relay) Start(ctx context.Context) error + func (r *Relay) Stop() + type RelayOption func(*Relay) + func AllowDuplicates() RelayOption + func WithBackoff(b workflow.Backoff) RelayOption + func WithBatchSize(n int) RelayOption + func WithEnqueueTimeout(d time.Duration) RelayOption + func WithLease(d time.Duration) RelayOption + func WithMaxAttempts(n int) RelayOption + func WithOnDead(fn DeadFunc) RelayOption + func WithPollInterval(d time.Duration) RelayOption