Help us shape the future of Go! Take the 2026 Go Developer Survey

client

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoConfig         = errors.New("No config exists for this user")
	ErrResourceNotFound = errors.New("requested resource not found")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	User            string `yaml:"user"`
	Key             string `yaml:"key"`
	Address         string `yaml:"address"`
	ID              string `yaml:"id"`
	TLS             tls.ClientConfig
	UseLegacyRoutes bool   `yaml:"use_legacy_routes"`
	AuthToken       string `yaml:"auth_token"`
	RulerAPIPath    string `yaml:"ruler_api_path"`
}

Config is used to configure a Ruler Client

type CortexClient

type CortexClient struct {
	Client http.Client
	// contains filtered or unexported fields
}

CortexClient is used to get and load rules into a cortex ruler

func New

func New(cfg Config) (*CortexClient, error)

New returns a new Client

func (*CortexClient) CreateAlertmanagerConfig

func (r *CortexClient) CreateAlertmanagerConfig(_ context.Context, cfg string, templates map[string]string) error

CreateAlertmanagerConfig creates a new alertmanager config

func (*CortexClient) CreateRuleGroup

func (r *CortexClient) CreateRuleGroup(_ context.Context, namespace string, rg rwrulefmt.RuleGroup) error

CreateRuleGroup creates a new rule group

func (*CortexClient) DeleteAlermanagerConfig

func (r *CortexClient) DeleteAlermanagerConfig(_ context.Context) error

DeleteAlermanagerConfig deletes the users alertmanagerconfig

func (*CortexClient) DeleteRuleGroup

func (r *CortexClient) DeleteRuleGroup(_ context.Context, namespace, groupName string) error

DeleteRuleGroup deletes a rule group

func (*CortexClient) DeleteRuleNamespace

func (r *CortexClient) DeleteRuleNamespace(_ context.Context, namespace string) error

DeleteRuleNamespace deletes a rule namespace

func (*CortexClient) GetAlertmanagerConfig

func (r *CortexClient) GetAlertmanagerConfig(_ context.Context) (string, map[string]string, error)

GetAlertmanagerConfig retrieves a rule group

func (*CortexClient) GetRuleGroup

func (r *CortexClient) GetRuleGroup(_ context.Context, namespace, groupName string) (*rwrulefmt.RuleGroup, error)

GetRuleGroup retrieves a rule group

func (*CortexClient) ListRules

func (r *CortexClient) ListRules(_ context.Context, namespace string) (map[string][]rwrulefmt.RuleGroup, error)

ListRules retrieves a rule group

func (*CortexClient) Query

func (r *CortexClient) Query(_ context.Context, query string) (*http.Response, error)

Query executes a PromQL query against the Cortex cluster.

Jump to

Keyboard shortcuts

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