Documentation
¶
Overview ¶
Package postgres implements storage.Store on top of PostgreSQL via the pgx stdlib driver. It mirrors the SQLite backend but uses $N placeholders and a SELECT ... FOR UPDATE SKIP LOCKED claim so the queue scales to many workers and instances.
Index ¶
- type Store
- func (s *Store) ClaimDue(ctx context.Context, now time.Time, lease time.Duration, limit int) ([]core.PendingDelivery, error)
- func (s *Store) Close() error
- func (s *Store) CreateDestination(ctx context.Context, d core.Destination) error
- func (s *Store) CreateSource(ctx context.Context, src core.Source, secret []byte) error
- func (s *Store) DeliveriesForEvent(ctx context.Context, eventID string) ([]core.PendingDelivery, error)
- func (s *Store) Enqueue(ctx context.Context, p core.PendingDelivery) error
- func (s *Store) GetDestination(ctx context.Context, id string) (core.Destination, error)
- func (s *Store) GetEvent(ctx context.Context, id string) (core.Event, error)
- func (s *Store) GetSource(ctx context.Context, name string) (core.Source, error)
- func (s *Store) ListAttempts(ctx context.Context, eventID string) ([]core.DeliveryAttempt, error)
- func (s *Store) ListDeadLetters(ctx context.Context, limit, offset int) ([]core.PendingDelivery, error)
- func (s *Store) ListDestinations(ctx context.Context, source string) ([]core.Destination, error)
- func (s *Store) ListEvents(ctx context.Context, f storage.EventFilter) ([]core.Event, error)
- func (s *Store) ListSources(ctx context.Context) ([]core.Source, error)
- func (s *Store) MarkDeadLetter(ctx context.Context, id string) error
- func (s *Store) MarkDelivered(ctx context.Context, id string) error
- func (s *Store) Prune(ctx context.Context, normalCutoff, failedCutoff time.Time) (int, error)
- func (s *Store) RecordAttempt(ctx context.Context, a core.DeliveryAttempt) error
- func (s *Store) Reschedule(ctx context.Context, id string, attempt int, next time.Time) error
- func (s *Store) SaveEvent(ctx context.Context, e core.Event) (string, bool, error)
- func (s *Store) SourceSecret(ctx context.Context, name string) ([]byte, error)
- func (s *Store) UpdateDestination(ctx context.Context, d core.Destination) error
- func (s *Store) UpdateSource(ctx context.Context, src core.Source, secret []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the Postgres-backed storage.Store implementation.
func Open ¶
Open connects to the Postgres database at dsn, applies migrations, and returns a ready Store.
func (*Store) CreateDestination ¶
func (*Store) CreateSource ¶
func (*Store) DeliveriesForEvent ¶
func (*Store) GetDestination ¶
func (*Store) ListAttempts ¶
func (*Store) ListDeadLetters ¶
func (*Store) ListDestinations ¶
func (*Store) ListEvents ¶
func (*Store) RecordAttempt ¶
func (*Store) Reschedule ¶
func (*Store) SourceSecret ¶
func (*Store) UpdateDestination ¶
Click to show internal directories.
Click to hide internal directories.