Documentation ¶
Overview ¶
Package template is the base of code generation for type-specific trees
Index ¶
- type FilterFunc
- type MatchesFunc
- type TreeV4
- func (t *TreeV4) Add(address patricia.IPv4Address, tag uint, matchFunc MatchesFunc) (bool, int, error)
- func (t *TreeV4) Clone() *TreeV4
- func (t *TreeV4) Delete(address patricia.IPv4Address, matchFunc MatchesFunc, matchVal uint) (int, error)
- func (t *TreeV4) FindDeepestTag(address patricia.IPv4Address) (bool, uint, error)
- func (t *TreeV4) FindTags(address patricia.IPv4Address) ([]uint, error)
- func (t *TreeV4) FindTagsWithFilter(address patricia.IPv4Address, filterFunc FilterFunc) ([]uint, error)
- func (t *TreeV4) Set(address patricia.IPv4Address, tag uint) (bool, int, error)
- type TreeV6
- func (t *TreeV6) Add(address patricia.IPv6Address, tag uint, matchFunc MatchesFunc) (bool, int, error)
- func (t *TreeV6) Clone() *TreeV6
- func (t *TreeV6) Delete(address patricia.IPv6Address, matchFunc MatchesFunc, matchVal uint) (int, error)
- func (t *TreeV6) FindDeepestTag(address patricia.IPv6Address) (bool, uint, error)
- func (t *TreeV6) FindTags(address patricia.IPv6Address) ([]uint, error)
- func (t *TreeV6) FindTagsWithFilter(address patricia.IPv6Address, filterFunc FilterFunc) ([]uint, error)
- func (t *TreeV6) Set(address patricia.IPv6Address, tag uint) (bool, int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilterFunc ¶
FilterFunc is called on each result to see if it belongs in the resulting set
type MatchesFunc ¶
MatchesFunc is called to check if tag data matches the input value
type TreeV4 ¶
type TreeV4 struct {
// contains filtered or unexported fields
}
TreeV4 is an IP Address patricia tree
func (*TreeV4) Add ¶
func (t *TreeV4) Add(address patricia.IPv4Address, tag uint, matchFunc MatchesFunc) (bool, int, error)
Add adds a tag to the tree - if matchFunc is non-nil, it will be used to ensure uniqueness at this node - returns whether the tag count at this address was increased, and how many tags at this address
func (*TreeV4) Clone ¶
Clone creates an identical copy of the tree - Note: the items in the tree are not deep copied
func (*TreeV4) Delete ¶
func (t *TreeV4) Delete(address patricia.IPv4Address, matchFunc MatchesFunc, matchVal uint) (int, error)
Delete a tag from the tree if it matches matchVal, as determined by matchFunc. Returns how many tags are removed
func (*TreeV4) FindDeepestTag ¶
FindDeepestTag finds a tag at the deepest level in the tree, representing the closest match - if that target node has multiple tags, the first in the list is returned
func (*TreeV4) FindTags ¶
func (t *TreeV4) FindTags(address patricia.IPv4Address) ([]uint, error)
FindTags finds all matching tags that passes the filter function
func (*TreeV4) FindTagsWithFilter ¶
func (t *TreeV4) FindTagsWithFilter(address patricia.IPv4Address, filterFunc FilterFunc) ([]uint, error)
FindTagsWithFilter finds all matching tags that passes the filter function
type TreeV6 ¶
type TreeV6 struct {
// contains filtered or unexported fields
}
TreeV6 is an IP Address patricia tree
func (*TreeV6) Add ¶
func (t *TreeV6) Add(address patricia.IPv6Address, tag uint, matchFunc MatchesFunc) (bool, int, error)
Add adds a tag to the tree - if matchFunc is non-nil, it will be used to ensure uniqueness at this node - returns whether the tag count at this address was increased, and how many tags at this address
func (*TreeV6) Clone ¶
Clone creates an identical copy of the tree - Note: the items in the tree are not deep copied
func (*TreeV6) Delete ¶
func (t *TreeV6) Delete(address patricia.IPv6Address, matchFunc MatchesFunc, matchVal uint) (int, error)
Delete a tag from the tree if it matches matchVal, as determined by matchFunc. Returns how many tags are removed
func (*TreeV6) FindDeepestTag ¶
FindDeepestTag finds a tag at the deepest level in the tree, representing the closest match - if that target node has multiple tags, the first in the list is returned
func (*TreeV6) FindTags ¶
func (t *TreeV6) FindTags(address patricia.IPv6Address) ([]uint, error)
FindTags finds all matching tags that passes the filter function
func (*TreeV6) FindTagsWithFilter ¶
func (t *TreeV6) FindTagsWithFilter(address patricia.IPv6Address, filterFunc FilterFunc) ([]uint, error)
FindTagsWithFilter finds all matching tags that passes the filter function