Documentation
¶
Overview ¶
Package pgstore is the Postgres alerting.StateStore.
The schema is not applied by the store. A consumer applies it the way it applies every other migration: SchemaSQL renders the DDL for a schema name, and a consumer with its own migration tool copies that into a migration file (and pins it with a test comparing the file to SchemaSQL). Migrate applies it directly for a deployment that has no migration tool of its own.
Index ¶
- func Migrate(ctx context.Context, db *sql.DB, schema string) error
- func SchemaSQL(schema string) (string, error)
- type Store
- func (s *Store) Apply(ctx context.Context, ch alerting.Changes) error
- func (s *Store) Events(ctx context.Context, q alerting.EventQuery) ([]alerting.Event, error)
- func (s *Store) LoadOwner(ctx context.Context, owner string) ([]alerting.Instance, error)
- func (s *Store) Owners(ctx context.Context) ([]string, error)
- func (s *Store) PruneEvents(ctx context.Context, before time.Time) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements alerting.StateStore over database/sql with a Postgres driver.
Click to show internal directories.
Click to hide internal directories.