Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EqualMatcher ¶
type EqualMatcher struct {
// contains filtered or unexported fields
}
EqualMatcher matches on equality.
func (*EqualMatcher) Matches ¶
func (m *EqualMatcher) Matches(v string) bool
Matches implements Matcher interface.
type Labels ¶
type Labels []Label
Labels is a sorted set of labels. Order has to be guaranteed upon instantiation.
func FromStrings ¶
FromStrings creates new labels from pairs of strings.
func New ¶
New returns a sorted Labels from the given labels. The caller has to guarantee that all label names are unique.
func ReadLabels ¶
ReadLabels reads up to n label sets in a JSON formatted file fn. It is mostly useful to load testing data.
func (Labels) Get ¶
Get returns the value for the label with the given name. Returns an empty string if the label doesn't exist.
type Matcher ¶
type Matcher interface { // Name returns the label name the matcher should apply to. Name() string // Matches checks whether a value fulfills the constraints. Matches(v string) bool }
Matcher specifies a constraint for the value of a label.
func NewEqualMatcher ¶
NewEqualMatcher returns a new matcher matching an exact label value.
func NewMustRegexpMatcher ¶
NewRegexpMatcher returns a new matcher verifying that a value matches the regular expression pattern. Will panic if the pattern is not a valid regular expression.
func NewPrefixMatcher ¶
NewPrefixMatcher returns new Matcher for label name matching prefix.
func NewRegexpMatcher ¶
NewRegexpMatcher returns a new matcher verifying that a value matches the regular expression pattern.
type PrefixMatcher ¶
type PrefixMatcher struct {
// contains filtered or unexported fields
}
PrefixMatcher implements Matcher for labels which values matches prefix.
func (*PrefixMatcher) Matches ¶
func (m *PrefixMatcher) Matches(v string) bool
Matches implements Matcher interface.
func (*PrefixMatcher) Name ¶
func (m *PrefixMatcher) Name() string
Name implements Matcher interface.
func (*PrefixMatcher) Prefix ¶
func (m *PrefixMatcher) Prefix() string
Prefix returns matching prefix.