Documentation
¶
Overview ¶
Package whpgstate keeps the state of each postgres webhook source's listener (#2408) in webhook_pg_listeners: which replica listens and since when, what it filed and refused, and its last failure, so a source's page on any replica shows how its listener is going. Nothing of a payload is kept.
Index ¶
- type State
- type States
- func (s *States) Failed(ctx context.Context, source, msg string, at time.Time) error
- func (s *States) Filed(ctx context.Context, source string, delivered, rejected int64, at time.Time) error
- func (s *States) Get(ctx context.Context, source string) (State, error)
- func (s *States) Listening(ctx context.Context, source, replica string, since time.Time) error
- func (s *States) Stopped(ctx context.Context, source, replica string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type State ¶
type State struct {
// Replica is the replica listening, empty when none is.
Replica string `json:"replica"`
ListeningSince *time.Time `json:"listening_since,omitempty"`
LastEventAt *time.Time `json:"last_event_at,omitempty"`
Delivered int64 `json:"delivered"`
Rejected int64 `json:"rejected"`
LastError string `json:"last_error,omitempty"`
LastErrorAt *time.Time `json:"last_error_at,omitempty"`
}
State is how a postgres source's listener stands: which replica listens, since when, what it filed and refused, and its last failure.
type States ¶
type States struct {
// contains filtered or unexported fields
}
States keeps each source's state in webhook_pg_listeners. A write for a source deleted meanwhile changes nothing: the row went with the source.
func (*States) Filed ¶
func (s *States) Filed(ctx context.Context, source string, delivered, rejected int64, at time.Time) error
Filed adds what one delivery filed and refused.
Click to show internal directories.
Click to hide internal directories.