mimir

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package mimir provides a simple client for the required Mimir API resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthTransport

type BasicAuthTransport struct {
	Username  string
	Password  string
	Transport http.RoundTripper
}

BasicAuthTransport is a transport that adds basic auth to the request.

func (*BasicAuthTransport) RoundTrip

func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip adds basic auth to the request.

type Client

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

Client is a simple client for the required Mimir API resources.

func NewClient

func NewClient(config Config) (*Client, error)

NewClient creates a new client with the given configuration.

func (*Client) DeleteNamespace

func (c *Client) DeleteNamespace(ctx context.Context, namespace string) error

DeleteNamespace deletes all the rule groups in a namespace (including the namespace itself).

func (*Client) Ready

func (c *Client) Ready(ctx context.Context) error

Ready checks if mimir is ready to serve traffic.

func (*Client) SetRuleGroup

func (c *Client) SetRuleGroup(ctx context.Context, namespace string, ruleGroup rulefmt.RuleGroup) error

SetRuleGroup creates or updates a rule group.

type Config

type Config struct {
	Address           string
	PrometheusPrefix  string
	BasicAuthUsername string
	BasicAuthPassword string
}

Config is used to configure the client.

Jump to

Keyboard shortcuts

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