Files
karma/store/store.go
Łukasz Mierzwa 3de3a9c481 Generate flag for each environment key
This allows to set config keys via flags, in additions to current env variable only configuration. Flags are autogenerated from supported env keys.
2017-03-26 13:38:37 -07:00

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{}
)