Versions in this module Expand all Collapse all v1 v1.1.0 Jul 10, 2026 v1.0.0 Jul 6, 2026 Changes in this version + func CountDeadEvents(ctx context.Context, pool *pgxpool.Pool) (int64, error) + func DiscardDeadEvent(ctx context.Context, pool *pgxpool.Pool, id uuid.UUID) error + func PublishDLQDepth(ctx context.Context, pool *pgxpool.Pool, m observability.Metrics) error + func ReplayDeadEvent(ctx context.Context, pool *pgxpool.Pool, id uuid.UUID) error + type DeadEventEntry struct + Attempts int + EventType string + FailedAt *time.Time + ID uuid.UUID + LastError string + MaxAttempts int + Payload []byte + TenantID uuid.UUID + func ListDeadEvents(ctx context.Context, pool *pgxpool.Pool, limit int) ([]DeadEventEntry, error) + type DispatchedEvent struct + Actor json.RawMessage + ID uuid.UUID + Payload json.RawMessage + Resource resource.Ref + SchemaVersion int + TenantID uuid.UUID + Type string + type Event struct + Actor json.RawMessage + ID uuid.UUID + Payload any + Resource resource.Ref + SchemaVersion int + TenantID uuid.UUID + Type string + type Handler func(ctx context.Context, db database.TenantDB, e DispatchedEvent) error + type HandlerRegistry struct + func NewHandlerRegistry() *HandlerRegistry + func (r *HandlerRegistry) Err() error + func (r *HandlerRegistry) Subscribe(eventType, handlerName string, fn Handler) + type Relay struct + func NewRelay(pool *pgxpool.Pool, txm database.TxManager, registry *HandlerRegistry, ...) *Relay + func (r *Relay) DispatchOnce(ctx context.Context) (int, error) + func (r *Relay) RequeueFailed(ctx context.Context, cooldown time.Duration) error + func (r *Relay) Run(ctx context.Context, poll time.Duration) error + type RelayOption func(*Relay) + func WithRelayTracer(tr observability.Tracer) RelayOption + type Writer interface + Write func(ctx context.Context, db database.TenantDB, e Event) error + func NewWriter(idgen model.IDGen, opts ...WriterOption) Writer + type WriterOption func(*pgWriter) + func WithWriterTracer(tr observability.Tracer) WriterOption