Documentation
¶
Index ¶
- Variables
- type ConstraintsFunc
- type Entry
- type LookupMatcher
- type LookupMatcherFunc
- type LookupOption
- type Option
- type Trie
- func (t *Trie[V]) Add(hostPattern, pathPattern string, value V) error
- func (t *Trie[V]) Clone() *Trie[V]
- func (t *Trie[V]) Delete(hostPattern, pathPattern string, matcher ValueMatcher[V]) error
- func (t *Trie[V]) Empty() bool
- func (t *Trie[V]) FindEntry(host, path string, matcher LookupMatcher[V]) (*Entry[V], error)
- func (t *Trie[V]) Lookup(hostPattern, pathPattern string, opts ...LookupOption[V]) ([]*Trie[V], error)
- type ValueMatcher
- type ValueMatcherFunc
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ConstraintsFunc ¶
type LookupMatcher ¶
type LookupMatcher[V any] interface { // Match should return true if the value should be returned by the lookup. Match(value V, keys, values []string) bool }
LookupMatcher is used for additional checks while performing the lookup of values in the spanned tree.
type LookupMatcherFunc ¶
The LookupMatcherFunc type is an adapter to allow the use of ordinary functions as match functions. If f is a function with the appropriate signature, LookupMatcherFunc(f) is a LookupMatcher that calls f.
func (LookupMatcherFunc[V]) Match ¶
func (f LookupMatcherFunc[V]) Match(value V, keys, values []string) bool
Match calls f(value).
type LookupOption ¶
type LookupOption[V any] func(opts *lookupOpts[V])
func WithExactMatch ¶
func WithExactMatch[V any]() LookupOption[V]
func WithWildcardMatch ¶
func WithWildcardMatch[V any]() LookupOption[V]
type Option ¶
type Option[V any] func(n *Trie[V])
func WithValuesConstraints ¶
func WithValuesConstraints[V any](constraints ConstraintsFunc[V]) Option[V]
type Trie ¶
type Trie[V any] struct { // contains filtered or unexported fields }
func (*Trie[V]) Delete ¶
func (t *Trie[V]) Delete(hostPattern, pathPattern string, matcher ValueMatcher[V]) error
func (*Trie[V]) FindEntry ¶
func (t *Trie[V]) FindEntry(host, path string, matcher LookupMatcher[V]) (*Entry[V], error)
func (*Trie[V]) Lookup ¶
func (t *Trie[V]) Lookup(hostPattern, pathPattern string, opts ...LookupOption[V]) ([]*Trie[V], error)
type ValueMatcher ¶
type ValueMatcher[V any] interface { // Match should return true if the value should be deleted from the tree. Match(value V) bool }
ValueMatcher is used for additional checks while deleting of values in the spanned tree.
type ValueMatcherFunc ¶
The ValueMatcherFunc type is an adapter to allow the use of ordinary functions as match functions. If f is a function with the appropriate signature, ValueMatcherFunc(f) is a ValueMatcher that calls f.
func (ValueMatcherFunc[V]) Match ¶
func (f ValueMatcherFunc[V]) Match(value V) bool
Match calls f(value).
Click to show internal directories.
Click to hide internal directories.