(matchers []string)
| 1651 | } |
| 1652 | |
| 1653 | func parseMatchersParam(matchers []string) ([][]*labels.Matcher, error) { |
| 1654 | var matcherSets [][]*labels.Matcher |
| 1655 | for _, s := range matchers { |
| 1656 | matchers, err := parser.ParseMetricSelector(s) |
| 1657 | if err != nil { |
| 1658 | return nil, err |
| 1659 | } |
| 1660 | matcherSets = append(matcherSets, matchers) |
| 1661 | } |
| 1662 | |
| 1663 | OUTER: |
| 1664 | for _, ms := range matcherSets { |
| 1665 | for _, lm := range ms { |
| 1666 | if lm != nil && !lm.Matches("") { |
| 1667 | continue OUTER |
| 1668 | } |
| 1669 | } |
| 1670 | return nil, errors.New("match[] must contain at least one non-empty matcher") |
| 1671 | } |
| 1672 | return matcherSets, nil |
| 1673 | } |
| 1674 | |
| 1675 | func matches(l labels.Labels, matchers ...*labels.Matcher) bool { |
| 1676 | for _, m := range matchers { |
no outgoing calls
no test coverage detected