Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Constraint ¶
Constraints restrict the results of a selector to a subset of current matches.
func To ¶
func To(index routing.Index) Constraint
To restricts the selection to items less-than-or-equal-to the index. Use with From to implement range queries.
func Where ¶
func Where(match Matcher) Constraint
Where restricts a selection according to some arbitrary criteria. It is effectively a filter.
func While ¶
func While(predicate Matcher) Constraint
While iterates over a selection until the predicate returns boolean false.
type Matcher ¶
type Matcher interface { // Match returns true if the supplied record matches // some arbitrary criteria. It is used to implement // filtering. See: Where. Match(routing.Record) bool }
Matcher reports whether a routing record matches some arbitrary criteria.
type Query ¶
func (Query) Iter ¶
Iter traverses the snapshot in lexicographical order, unless q is the result of having called Reverse() on a non-reversed Query.
type Selector ¶
Selector specifies an iteration strategy over a set of routing records.
func From ¶
Select all records, beginning with the indexed record, and iterating in lexicographic order.
func (Selector) Bind ¶
func (selection Selector) Bind(f Constraint) Selector
Bind a constraint to the selector, causing it to select a subset of the current selection.