Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Parser ¶
Parser parses a routing rule expression into a TreeBuilder.
func NewParser ¶
NewParser constructs a parser for the given matchers.
Rules are parsed as Go expressions via go/parser, so each matcher is registered under every case variant (exact, lower, upper, title) to make matching case-insensitive. The canonical matcher name (as given) is what ends up in the resulting Tree.
type Tree ¶
Tree represents the rules' tree structure used for routing matchers. Leaf nodes hold a Matcher name, optional negation, and string values. Internal nodes hold an "and"/"or" operator with left and right children.
func (*Tree) ParseMatchers ¶
ParseMatchers returns the subset of values in the Tree matching the given matchers.