Documentation ¶
Overview ¶
Package iptree8 implements radix tree data structure for IPv4 and IPv6 networks as key and uint8 as value.
Index ¶
- type Pair
- type Tree
- func (t *Tree) DeleteByIP(ip net.IP) (*Tree, bool)
- func (t *Tree) DeleteByNet(n *net.IPNet) (*Tree, bool)
- func (t *Tree) Enumerate() chan Pair
- func (t *Tree) GetByIP(ip net.IP) (uint8, bool)
- func (t *Tree) GetByNet(n *net.IPNet) (uint8, bool)
- func (t *Tree) InplaceInsertIP(ip net.IP, value uint8)
- func (t *Tree) InplaceInsertNet(n *net.IPNet, value uint8)
- func (t *Tree) InsertIP(ip net.IP, value uint8) *Tree
- func (t *Tree) InsertNet(n *net.IPNet, value uint8) *Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree is a radix tree for IPv4 and IPv6 networks.
func (*Tree) DeleteByIP ¶
DeleteByIP removes node by given IP address. The method returns new tree (old one remains unaffected) and flag indicating if deletion happens indeed.
func (*Tree) DeleteByNet ¶
DeleteByNet removes subtree which is contained by given network. The method returns new tree (old one remains unaffected) and flag indicating if deletion happens indeed.
func (*Tree) Enumerate ¶
Enumerate returns channel which is populated by key-value pairs of tree content.
func (*Tree) GetByIP ¶
GetByIP gets value for network which is equal to or contains given IP address.
func (*Tree) GetByNet ¶
GetByNet gets value for network which is equal to or contains given network.
func (*Tree) InplaceInsertIP ¶
InplaceInsertIP inserts (or replaces) value using given IP address as a key in current tree.
func (*Tree) InplaceInsertNet ¶
InplaceInsertNet inserts (or replaces) value using given network as a key in current tree.