From fdace3726f4ade6b3a18a0b200757a41c5ea1373 Mon Sep 17 00:00:00 2001 From: Shaun Crampton Date: Mon, 12 Jun 2017 15:05:49 +0100 Subject: [PATCH] Fix selector interface defn to match parser version. --- lib/selector/selector.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/selector/selector.go b/lib/selector/selector.go index a66a47b3b..5a4b3ba83 100644 --- a/lib/selector/selector.go +++ b/lib/selector/selector.go @@ -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) }