Documentation
¶
Overview ¶
Package postgres is a store.Store in PostgreSQL, shared by the almanacs of one deployment and separated by almanac.
Index ¶
- func Migrate(ctx context.Context, pool *pgxpool.Pool) error
- type Store
- func (s *Store) Admit(ctx context.Context, source, deliveryID string, admission store.Admission) (store.Ingest, error)
- func (s *Store) Claim(ctx context.Context, request store.ClaimRequest) (store.Claim, error)
- func (s *Store) Close()
- func (s *Store) Delivered(ctx context.Context, key string) error
- func (s *Store) DeliveryFailed(ctx context.Context, key, reason string, giveUp int) error
- func (s *Store) Note(ctx context.Context, key string, value json.RawMessage, mode effect.Mode) error
- func (s *Store) Outbox(ctx context.Context, runID string) ([]store.Entry, error)
- func (s *Store) Ready(ctx context.Context) error
- func (s *Store) Record(ctx context.Context, runID, name string, occurrence int, value json.RawMessage) error
- func (s *Store) Recorded(ctx context.Context, runID, name string, occurrence int) (json.RawMessage, bool, error)
- func (s *Store) Recover(ctx context.Context) (int, error)
- func (s *Store) Release(ctx context.Context, runID string, links []workflow.Subject, ...) error
- func (s *Store) Remember(ctx context.Context, workflow, key string, trace store.Trace) error
- func (s *Store) Run(ctx context.Context, runID string) (store.Run, bool, error)
- func (s *Store) RunsFor(ctx context.Context, subject workflow.Subject) ([]string, error)
- func (s *Store) RunsSince(ctx context.Context, since time.Time) ([]store.Run, error)
- func (s *Store) Traces(ctx context.Context, workflow, key string, since time.Time) ([]store.Trace, error)
- func (s *Store) Undelivered(ctx context.Context) ([]store.Entry, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is one almanac's state in PostgreSQL.
func Connect ¶
Connect reaches the database at url, brings the schema up to date, and returns almanac's state in it. Close the store when done with it.
func New ¶
New is almanac's state in the database pool reaches. The schema must already be up to date: see Migrate. Several stores may share one pool.
func (*Store) Admit ¶
func (s *Store) Admit(ctx context.Context, source, deliveryID string, admission store.Admission) (store.Ingest, error)
Admit implements store.Store.
func (*Store) DeliveryFailed ¶
DeliveryFailed implements store.Store. The reason is kept with the entry; a U+0000 in it, which PostgreSQL's text refuses, becomes U+FFFD.
func (*Store) Note ¶
func (s *Store) Note(ctx context.Context, key string, value json.RawMessage, mode effect.Mode) error
Note implements store.Store.
func (*Store) Record ¶
func (s *Store) Record(ctx context.Context, runID, name string, occurrence int, value json.RawMessage) error
Record implements store.Store.
func (*Store) Recorded ¶
func (s *Store) Recorded(ctx context.Context, runID, name string, occurrence int) (json.RawMessage, bool, error)
Recorded implements store.Store.
func (*Store) Release ¶
func (s *Store) Release(ctx context.Context, runID string, links []workflow.Subject, effects []json.RawMessage, mode effect.Mode) error
Release implements store.Store.