Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API allows retrieving Cortex configs.
func (*API) GetOrgConfigs ¶
func (c *API) GetOrgConfigs(since ConfigID) (*CortexConfigsResponse, error)
GetOrgConfigs returns all Cortex configurations from a configs API server that have been updated after the given ConfigID was last updated.
type ConfigID ¶
type ConfigID int
A ConfigID is the ID of a single organization's Cortex configuration.
type CortexConfig ¶
type CortexConfig struct {
// RulesFiles maps from a rules filename to file contents.
RulesFiles map[string]string `json:"rules_files"`
AlertmanagerConfig string `json:"alertmanager_config"`
}
A CortexConfig is a Cortex configuration for a single organization.
func (CortexConfig) GetAlertmanagerConfig ¶
func (c CortexConfig) GetAlertmanagerConfig() (*config.Config, error)
GetAlertmanagerConfig returns the Alertmanager config from the Cortex configuration.
type CortexConfigView ¶
type CortexConfigView struct {
ConfigID ConfigID `json:"id"`
Config CortexConfig `json:"config"`
}
CortexConfigView is what's returned from the Weave Cloud configs service when we ask for all Cortex configurations.
The configs service is essentially a JSON blob store that gives each _version_ of a configuration a unique ID and guarantees that later versions have greater IDs.
type CortexConfigsResponse ¶
type CortexConfigsResponse struct {
// Configs maps organization ID to their latest CortexConfigView.
Configs map[string]CortexConfigView `json:"configs"`
}
CortexConfigsResponse is a response from server for GetOrgConfigs.
func (CortexConfigsResponse) GetLatestConfigID ¶
func (c CortexConfigsResponse) GetLatestConfigID() ConfigID
GetLatestConfigID returns the last config ID from a set of configs.