import "github.com/prometheus/tsdb/labels"
Compare compares the two label sets. The result will be 0 if a==b, <0 if a < b, and >0 if a > b.
type EqualMatcher struct {
// contains filtered or unexported fields
}
EqualMatcher matches on equality.
func (m EqualMatcher) Matches(v string) bool
Matches implements Matcher interface.
func (m EqualMatcher) Name() string
Name implements Matcher interface.
func (m EqualMatcher) String() string
String implements Matcher interface.
func (m EqualMatcher) Value() string
Value returns the matched value.
Label is a key/value pair of strings.
Labels is a sorted set of labels. Order has to be guaranteed upon instantiation.
FromMap returns new sorted Labels from the given map.
FromStrings creates new labels from pairs of strings.
New returns a sorted Labels from the given labels. The caller has to guarantee that all label names are unique.
ReadLabels reads up to n label sets in a JSON formatted file fn. It is mostly useful to load testing data.
Equals returns whether the two label sets are equal.
Get returns the value for the label with the given name. Returns an empty string if the label doesn't exist.
Hash returns a hash value for the label set.
Map returns a string map of the labels.
WithoutEmpty returns the labelset without empty labels. May return the same labelset.
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 // String returns a human readable matcher. String() string }
Matcher specifies a constraint for the value of a label.
NewEqualMatcher returns a new matcher matching an exact label value.
NewMustRegexpMatcher returns a new matcher verifying that a value matches the regular expression pattern. Will panic if the pattern is not a valid regular expression.
NewRegexpMatcher returns a new matcher verifying that a value matches the regular expression pattern.
Not inverts the matcher's matching result.
NotMatcher inverts the matching result for a matcher.
func (m NotMatcher) Matches(v string) bool
func (m NotMatcher) String() string
type RegexpMatcher struct {
// contains filtered or unexported fields
}
func (m RegexpMatcher) Matches(v string) bool
func (m RegexpMatcher) Name() string
func (m RegexpMatcher) String() string
func (m RegexpMatcher) Value() string
Selector holds constraints for matching against a label set.
Matches returns whether the labels satisfy all matchers.
Slice is a sortable slice of label sets.
Package labels imports 10 packages (graph) and is imported by 57 packages. Updated 2019-06-01. Refresh now. Tools for package owners.