parsing

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package parsing contains methods for parsing strings into various types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromPromLabelsToMutingMatchers

func FromPromLabelsToMutingMatchers(s string) ([]*models.Configv1MutingRuleLabelMatcher, error)

FromPromLabelsToMutingMatchers converts a string representing labels in Prometheus format to a list of muting matchers.

func OpToMutingMatcherType

func OpToMutingMatcherType(op string) (models.Configv1MutingRuleLabelMatcherMatcherType, error)

OpToMutingMatcherType converts an op string to a entities MutingMatcherType

func PromLabelParser

func PromLabelParser() *participle.Parser[PromLabels]

PromLabelParser returns a parser for PromLabels

Types

type PromLabel

type PromLabel struct {
	Name  string `@Ident`                                     //nolint:govet
	Op    string `@(("=" "~") | "=" | ("!" "=") | ("!" "~"))` //nolint:govet
	Value string `@String`                                    //nolint:govet
}

PromLabel represents a single key-value pair.

type PromLabels

type PromLabels struct {
	Labels []PromLabel `"{" ( @@ ","? )* "}"` //nolint:govet
}

PromLabels represents a list of key-value labels surrounded by brackets.

Jump to

Keyboard shortcuts

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