configs

package
v0.0.0-...-90d47c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// RulesFiles maps from a rules filename to file contents.
	RulesFiles         RulesConfig `json:"rules_files"`
	AlertmanagerConfig string      `json:"alertmanager_config"`
}

A Config is a Cortex configuration for a single user.

type ID

type ID int

An ID is the ID of a single users's Cortex configuration. When a configuration changes, it gets a new ID.

type RulesConfig

type RulesConfig map[string]string

RulesConfig are the set of rules files for a particular organization.

func (RulesConfig) Equal

func (c RulesConfig) Equal(o RulesConfig) bool

Equal compares two RulesConfigs for equality.

instance Eq RulesConfig

func (RulesConfig) Parse

func (c RulesConfig) Parse() (map[string][]rules.Rule, error)

Parse rules from the Cortex configuration.

Strongly inspired by `loadGroups` in Prometheus.

type VersionedRulesConfig

type VersionedRulesConfig struct {
	ID        ID          `json:"id"`
	Config    RulesConfig `json:"config"`
	DeletedAt time.Time   `json:"deleted_at"`
}

VersionedRulesConfig is a RulesConfig together with a version. `data Versioned a = Versioned { id :: ID , config :: a }`

func (VersionedRulesConfig) IsDeleted

func (vr VersionedRulesConfig) IsDeleted() bool

IsDeleted tells you if the config is deleted.

type View

type View struct {
	ID        ID        `json:"id"`
	Config    Config    `json:"config"`
	DeletedAt time.Time `json:"deleted_at"`
}

View 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.

func (View) GetVersionedRulesConfig

func (v View) GetVersionedRulesConfig() *VersionedRulesConfig

GetVersionedRulesConfig specializes the view to just the rules config.

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL