client

package
v0.40.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 17 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 {
	ID                   string
	Address              string
	UseLegacyRoutes      bool
	HTTPClientConfig     config.HTTPClientConfig
	PrometheusHTTPPrefix string
}

Config is used to configure a MimirClient.

type Interface

type Interface interface {
	CreateRuleGroup(ctx context.Context, namespace string, rg rulefmt.RuleGroup) error
	DeleteRuleGroup(ctx context.Context, namespace, groupName string) error
	ListRules(ctx context.Context, namespace string) (map[string][]rulefmt.RuleGroup, error)
}

type MimirClient

type MimirClient struct {
	// contains filtered or unexported fields
}

MimirClient is a client to the Mimir API.

func New

func New(logger log.Logger, cfg Config, timingHistogram *prometheus.HistogramVec) (*MimirClient, error)

New returns a new MimirClient.

func (*MimirClient) CreateRuleGroup

func (r *MimirClient) CreateRuleGroup(ctx context.Context, namespace string, rg rulefmt.RuleGroup) error

CreateRuleGroup creates a new rule group

func (*MimirClient) DeleteRuleGroup

func (r *MimirClient) DeleteRuleGroup(ctx context.Context, namespace, groupName string) error

DeleteRuleGroup deletes a rule group

func (*MimirClient) ListRules

func (r *MimirClient) ListRules(ctx context.Context, namespace string) (map[string][]rulefmt.RuleGroup, error)

ListRules retrieves a rule group

type RemoteWriteConfig

type RemoteWriteConfig struct {
	URL string `json:"url,omitempty"`
}

RemoteWriteConfig is used to specify a remote write endpoint

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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