Documentation ¶
Overview ¶
Package rules provides primitives for working with routing rules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrefixTrie ¶
type PrefixTrie struct {
// contains filtered or unexported fields
}
PrefixTrie efficiently checks if a slice of bytes contains one of the prefixes prevoiusly added to the tree.
func NewPrefixTrie ¶
func NewPrefixTrie() *PrefixTrie
NewPrefixTrie makes a new instance of a PrefixTrie.
func (*PrefixTrie) Check ¶
func (t *PrefixTrie) Check(s []byte) bool
Check if string s contains any of the prefixes
type Rule ¶
type Rule struct { Regexs []string Prefixes []string Targets []target.ClusterTarget Continue bool CompiledRE []*regexp.Regexp PrefixTrie *PrefixTrie // contains filtered or unexported fields }
Rule is a routing rule.
type Rules ¶
type Rules struct {
// contains filtered or unexported fields
}
Rules represent all the routing rules/routing table.
func Build ¶
func Build(crs *conf.Rules, clusters target.Clusters, measureRegex bool, ms *metrics.Prom) (Rules, error)
Build reads rules from config, compiles them.
Click to show internal directories.
Click to hide internal directories.