package vpnid
import "github.com/tlop503/ipcheq2/src/vpnid"
Index
- func Collapse(ips []net.IP) []*net.IPNet
- func Initialize(path string) (cidranger.Ranger, error)
- func Query(ip netip.Addr, ranger cidranger.Ranger) (string, bool, error)
- type ConfigEntry
- type TreeEntry
Functions
func Collapse
func Collapse(ips []net.IP) []*net.IPNet
Collapse takes a sorted list of IPs and returns minimal CIDR subnets
func Initialize
func Initialize(path string) (cidranger.Ranger, error)
func Query
func Query(ip netip.Addr, ranger cidranger.Ranger) (string, bool, error)
Types
type ConfigEntry
type ConfigEntry struct { Name string Path string }
ConfigEntry represents one line in the config file: name → path
type TreeEntry
type TreeEntry struct { Prefix netip.Prefix Provider string }
func (TreeEntry) Network
func (t TreeEntry) Network() net.IPNet
Network implements RangerEntry using net.IPNet