client

package
v0.4.12 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetRules returns all Cortex configurations from a configs API server
	// that have been updated after the given configs.ID was last updated.
	GetRules(ctx context.Context, since configs.ID) (map[string]configs.VersionedRulesConfig, error)

	// GetAlerts fetches all the alerts that have changes since since.
	GetAlerts(ctx context.Context, since configs.ID) (*ConfigsResponse, error)
}

Client is what the ruler and altermanger needs from a config store to process rules.

func New

func New(cfg Config) (Client, error)

New creates a new ConfigClient.

type Config

type Config struct {
	DBConfig db.Config

	// DEPRECATED
	ConfigsAPIURL flagext.URLValue

	// DEPRECATED. HTTP timeout duration for requests made to the Weave Cloud
	// configs service.
	ClientTimeout time.Duration
}

Config says where we can find the ruler configs.

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to config this to the given FlagSet

type ConfigsResponse

type ConfigsResponse struct {

	// Configs maps user ID to their latest configs.View.
	Configs map[string]configs.View `json:"configs"`
	// contains filtered or unexported fields
}

ConfigsResponse is a response from server for GetConfigs.

func (ConfigsResponse) GetLatestConfigID

func (c ConfigsResponse) GetLatestConfigID() configs.ID

GetLatestConfigID returns the last config ID from a set of configs.

Jump to

Keyboard shortcuts

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