Documentation ¶
Index ¶
- func NewInMemoryDB() *inMemoryDB
- func QueryAlertStats(ctx context.Context, db DB, q query.AlertStatsQuery) ([]query.StatsResult, error)
- type BoltDB
- func (b *BoltDB) Close() error
- func (b *BoltDB) QueryAlerts(ctx context.Context, query query.AlertQuery) []model.Alert
- func (b *BoltDB) QuerySilences(ctx context.Context, query query.SilenceQuery) []model.Silence
- func (b *BoltDB) StoreAlerts(ctx context.Context, alerts ...model.Alert) error
- func (b *BoltDB) StoreSilences(ctx context.Context, silences ...model.Silence) error
- type DB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInMemoryDB ¶
func NewInMemoryDB() *inMemoryDB
func QueryAlertStats ¶
func QueryAlertStats(ctx context.Context, db DB, q query.AlertStatsQuery) ([]query.StatsResult, error)
Types ¶
type BoltDB ¶
type BoltDB struct {
// contains filtered or unexported fields
}
BoltDB is a DB implementation that stores data in a BoltDB database.
func (*BoltDB) QueryAlerts ¶
func (*BoltDB) QuerySilences ¶
QuerySilences queries the database for silences matching the given query.
func (*BoltDB) StoreAlerts ¶
type DB ¶
type DB interface { // StoreAlerts stores the given alerts in the database, updating any existing alerts with the same labels. StoreAlerts(ctx context.Context, alerts ...model.Alert) error // QueryAlerts queries the database for alerts matching the given query. QueryAlerts(ctx context.Context, query query.AlertQuery) []model.Alert // StoreSilences stores the given silences in the database, updating any existing silences with the same ID. StoreSilences(ctx context.Context, silences ...model.Silence) error // QuerySilences queries the database for silences matching the given query. QuerySilences(ctx context.Context, query query.SilenceQuery) []model.Silence Close() error }
DB defines an interface that is able to process alerts, silences etc and store them (for some definition of store).
Click to show internal directories.
Click to hide internal directories.