alertmanager

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoLabelsProvided = errors.New("no filter/matchers provided")
)

Functions

func MatcherToString

func MatcherToString(matchers []*almodels.Matcher, pad bool) (out []string)

Convert matcher key-value pairs. If pad is true, then the output will be padded to be aligned with each other (keys and equal/regex/negation).

func ParseLabels

func ParseLabels(input string, allowDuplicates bool) (matchers []*almodels.Matcher, err error)

ParseLabels parses a string of labels into a list of matchers. If allowDuplicates is true, then duplicate matchers will be allowed, otherwise the last seen value will be used.

Types

type Client

type Client struct {
	*alclient.AlertmanagerAPI
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config models.ConfigAlertmanager, debug bool) (*Client, error)

func (*Client) HandleAuth

func (c *Client) HandleAuth(op *runtime.ClientOperation)

func (*Client) SilenceURL

func (c *Client) SilenceURL(id string) string

func (*Client) URL

func (c *Client) URL() string

type LabelEntry

type LabelEntry struct {
	Name    string `parser:"@Ident"`
	Matcher string `parser:"@Equality"`
	Value   string `parser:"( @StringSingle | @StringDouble | @Ident )"`
}

func (*LabelEntry) IsEqual

func (l *LabelEntry) IsEqual() *bool

func (*LabelEntry) IsRegex

func (l *LabelEntry) IsRegex() *bool

func (*LabelEntry) String

func (l *LabelEntry) String() string

type ParseResults

type ParseResults struct {
	Entries []*LabelEntry `parser:"( @@* | @@ ( ',' @@ )+ )"`
}

Jump to

Keyboard shortcuts

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