mirror of
https://github.com/prymitive/karma
synced 2026-05-17 04:16:42 +00:00
This allows to set config keys via flags, in additions to current env variable only configuration. Flags are autogenerated from supported env keys.
47 lines
981 B
Go
47 lines
981 B
Go
package store
|
|
|
|
import (
|
|
"sync"
|
|
"time"
|
|
|
|
"github.com/cloudflare/unsee/models"
|
|
)
|
|
|
|
type alertStoreType struct {
|
|
Store []models.UnseeAlertGroup
|
|
Timestamp time.Time
|
|
}
|
|
|
|
type silenceStoreType struct {
|
|
Store map[string]models.UnseeSilence
|
|
Timestamp time.Time
|
|
}
|
|
|
|
type colorStoreType struct {
|
|
Store models.UnseeColorMap
|
|
Timestamp time.Time
|
|
}
|
|
|
|
type autocompleteStore struct {
|
|
Store []models.UnseeAutocomplete
|
|
Timestamp time.Time
|
|
}
|
|
|
|
var (
|
|
// StoreLock guards access to all variables storing internal data
|
|
// (alerts, silences, colors, ac)
|
|
StoreLock = sync.RWMutex{}
|
|
|
|
// AlertStore holds all alerts retrieved from Alertmanager
|
|
AlertStore = alertStoreType{}
|
|
|
|
// SilenceStore holds all silences retrieved from Alertmanager
|
|
SilenceStore = silenceStoreType{}
|
|
|
|
// ColorStore holds all color maps generated from alerts
|
|
ColorStore = colorStoreType{}
|
|
|
|
// AutocompleteStore holds all autocomplete data generated from alerts
|
|
AutocompleteStore = autocompleteStore{}
|
|
)
|