Rename [label] query to selector

This commit is contained in:
Daniel Smith
2014-06-18 16:47:41 -07:00
parent c4649d539b
commit bc02b3c21a
19 changed files with 91 additions and 91 deletions

View File

@@ -30,15 +30,15 @@ type Labels interface {
type Set map[string]string
// All labels listed as a human readable string. Conveniently, exactly the format
// that ParseQuery takes.
// that ParseSelector takes.
func (ls Set) String() string {
query := make([]string, 0, len(ls))
selector := make([]string, 0, len(ls))
for key, value := range ls {
query = append(query, key+"="+value)
selector = append(selector, key+"="+value)
}
// Sort for determinism.
sort.StringSlice(query).Sort()
return strings.Join(query, ",")
sort.StringSlice(selector).Sort()
return strings.Join(selector, ",")
}
// Implement Labels interface.
@@ -46,7 +46,7 @@ func (ls Set) Get(label string) string {
return ls[label]
}
// Convenience function: convert these labels to a query.
func (ls Set) AsQuery() Query {
return QueryFromSet(ls)
// Convenience function: convert these labels to a selector.
func (ls Set) AsSelector() Selector {
return SelectorFromSet(ls)
}