MCPcopy Create free account
hub / github.com/prometheus/common / Validate

Method Validate

model/labelset.go:32–42  ·  view source on GitHub ↗

Validate checks whether all names and values in the label set are valid.

()

Source from the content-addressed store, hash-verified

30// Validate checks whether all names and values in the label set
31// are valid.
32func (ls LabelSet) Validate() error {
33 for ln, lv := range ls {
34 if !ln.IsValid() {
35 return fmt.Errorf("invalid name %q", ln)
36 }
37 if !lv.IsValid() {
38 return fmt.Errorf("invalid value %q", lv)
39 }
40 }
41 return nil
42}
43
44// Equal returns true iff both label sets have exactly the same key/value pairs.
45func (ls LabelSet) Equal(o LabelSet) bool {

Callers

nothing calls this directly

Calls 1

IsValidMethod · 0.45

Tested by

no test coverage detected