Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config configures the database.
func (*Config) RegisterFlags ¶
RegisterFlags adds the flags required to configure this to the given FlagSet.
type DB ¶
type DB interface {
RulesDB
GetConfig(userID string) (configs.View, error)
SetConfig(userID string, cfg configs.Config) error
GetAllConfigs() (map[string]configs.View, error)
GetConfigs(since configs.ID) (map[string]configs.View, error)
DeactivateConfig(userID string) error
RestoreConfig(userID string) error
Close() error
}
DB is the interface for the database.
type RulesDB ¶
type RulesDB interface {
// GetRulesConfig gets the user's ruler config
GetRulesConfig(userID string) (configs.VersionedRulesConfig, error)
// SetRulesConfig does a compare-and-swap (CAS) on the user's rules config.
// `oldConfig` must precisely match the current config in order to change the config to `newConfig`.
// Will return `true` if the config was updated, `false` otherwise.
SetRulesConfig(userID string, oldConfig, newConfig configs.RulesConfig) (bool, error)
// GetAllRulesConfigs gets all of the ruler configs
GetAllRulesConfigs() (map[string]configs.VersionedRulesConfig, error)
// GetRulesConfigs gets all of the configs that have been added or have
// changed since the provided config.
GetRulesConfigs(since configs.ID) (map[string]configs.VersionedRulesConfig, error)
}
RulesDB has ruler-specific DB interfaces.
func NewRulesDB ¶
NewRulesDB creates a new rules config database.
Click to show internal directories.
Click to hide internal directories.