compat

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFromFlags

func InitFromFlags(l log.Logger, f featurecontrol.Flagger)

InitFromFlags initializes the compat package from the flagger.

func IsValidLabelName

func IsValidLabelName(name model.LabelName) bool

IsValidLabelName returns true if the string is a valid label name.

func Matcher

func Matcher(input, origin string) (*labels.Matcher, error)

Matcher parses the matcher in the input string. It returns an error if the input is invalid or contains two or more matchers.

func Matchers

func Matchers(input, origin string) (labels.Matchers, error)

Matchers parses one or more matchers in the input string. It returns an error if the input is invalid.

Types

type ParseMatcher

type ParseMatcher func(input, origin string) (*labels.Matcher, error)

func ClassicMatcherParser

func ClassicMatcherParser(l log.Logger) ParseMatcher

ClassicMatcherParser uses the pkg/labels parser to parse the matcher in the input string.

func FallbackMatcherParser

func FallbackMatcherParser(l log.Logger) ParseMatcher

FallbackMatcherParser uses the new matchers/parse parser to parse zero or more matchers in the string. If this fails it reverts to the pkg/labels parser and emits a warning log line.

func UTF8MatcherParser

func UTF8MatcherParser(l log.Logger) ParseMatcher

UTF8MatcherParser uses the new matchers/parse parser to parse the matcher in the input string. If this fails it does not revert to the pkg/labels parser.

type ParseMatchers

type ParseMatchers func(input, origin string) (labels.Matchers, error)

func ClassicMatchersParser

func ClassicMatchersParser(l log.Logger) ParseMatchers

ClassicMatchersParser uses the pkg/labels parser to parse zero or more matchers in the input string. It returns an error if the input is invalid.

func FallbackMatchersParser

func FallbackMatchersParser(l log.Logger) ParseMatchers

FallbackMatchersParser uses the new matchers/parse parser to parse the matcher in the input string. If this fails it falls back to the pkg/labels parser and emits a warning log line.

func UTF8MatchersParser

func UTF8MatchersParser(l log.Logger) ParseMatchers

UTF8MatchersParser uses the new matchers/parse parser to parse zero or more matchers in the input string. If this fails it does not revert to the pkg/labels parser.

Jump to

Keyboard shortcuts

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