Add helper for making simple selector.

This commit is contained in:
Eric Tune
2014-11-21 13:33:05 -08:00
parent 9f5ebef3d8
commit 01434a8c04
2 changed files with 15 additions and 0 deletions

View File

@@ -483,3 +483,9 @@ func ParseSelector(selector string) (Selector, error) {
}
return andTerm(items), nil
}
// OneTermEqualSelector returns an object that matches objects where one label/field equals one value.
// Cannot return an error.
func OneTermEqualSelector(k, v string) Selector {
return &hasTerm{label: k, value: v}
}