package
Version:
v0.0.0-...-68fec7b
Opens a new window with list of versions in this module.
Published: Jan 6, 2023
License: MPL-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Whether two Cidr are equal (IP and masks match)
First Ipv4 address in a CIDR (ignores network address)
Get an IP address from a 32bit uint
Turn an IP address into a 32bit uint
Last Ipv4 address in a CIDR (ignores broadcast)
Convert a uint into an IPMask (from CIDR notation to go-internal)
Convert an IPMask into a byte, much like in CIDR notation (0-32)
type CidrValue struct {
Cidr *net.IPNet
Value interface{}
}
func New(merge func(a, b interface{}) interface{}) *Tree
func (t *Tree) AddIp(ip net.IP, value interface{})
Add a single IP to the tree
func (t *Tree) AddRange(start, end net.IP, value interface{})
Add a range of IPs to the tree (inclusive)
List all CIDR that describe the contents of the tree
Source Files
¶
Click to show internal directories.
Click to hide internal directories.