Skip to content

Commit

Permalink
Merge pull request #451 from fasaxc/fix-selector-iface
Browse files Browse the repository at this point in the history
Fix selector interface defn to match parser version.
  • Loading branch information
fasaxc authored Jun 12, 2017
2 parents 3cfe5e8 + fdace37 commit e40a090
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/selector/selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ import "github.com/projectcalico/libcalico-go/lib/selector/parser"

// Selector represents a label selector.
type Selector interface {
// Evaluate evaluates the selector against the given labels expressed as a concrete map.
Evaluate(labels map[string]string) bool
// EvaluateLabels evaluates the selector against the given labels expressed as an interface.
// This allows for labels that are calculated on the fly.
EvaluateLabels(labels parser.Labels) bool
// String returns a string that represents this selector.
String() string
UniqueId() string
// UniqueID returns the unique ID that represents this selector.
UniqueID() string
}

// Parse a string representation of a selector expression into a Selector.
func Parse(selector string) (sel parser.Selector, err error) {
func Parse(selector string) (sel Selector, err error) {
return parser.Parse(selector)
}

0 comments on commit e40a090

Please sign in to comment.