Documentation
¶
Overview ¶
Package outboxpostgres provides a supported Postgres-backed transactional outbox.
Index ¶
- Variables
- type Event
- type Options
- type Store
- func (s *Store) Complete(ctx context.Context, id string) error
- func (s *Store) Enqueue(ctx context.Context, event Event) error
- func (s *Store) Fail(ctx context.Context, id string, _ string) error
- func (s *Store) HealthChecker() ports.HealthChecker
- func (s *Store) Lease(ctx context.Context, limit int) ([]async.Job, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEventNotFound reports that an outbox event was not found for the current lease owner. ErrEventNotFound = errors.New("outbox event not found") // ErrInvalidEvent reports that an outbox event is missing required fields. ErrInvalidEvent = errors.New("invalid outbox event") // ErrInvalidTable reports that a configured table name is not a safe SQL identifier. ErrInvalidTable = errors.New("invalid outbox table") // ErrStoreNotConfigured reports that the store or pool was not configured. ErrStoreNotConfigured = errors.New("outbox postgres store not configured") )
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
Table string
Clock func() time.Time
LeaseOwner string
LeaseDuration time.Duration
RetryDelay time.Duration
MaxRetryDelay time.Duration
MaxAttempts int
}
Options configures the Postgres outbox store.
type Store ¶
type Store struct {
Pool ports.DatabasePool
// contains filtered or unexported fields
}
Store persists and leases outbox events in Postgres.
func New ¶
func New(pool ports.DatabasePool, opts Options) *Store
New creates a Postgres-backed outbox store.
func (*Store) HealthChecker ¶
func (s *Store) HealthChecker() ports.HealthChecker
HealthChecker returns a Postgres outbox dependency health checker.
Click to show internal directories.
Click to hide internal directories.