Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool []Range
Pool is a collection of IP Ranges.
type Range ¶
Range represents an IP range.
func New ¶
New returns new IP Range. If it is not a valid range (start and end IPs have different address-families, or start > end), New returns nil.
func ParseRange ¶
ParseRange parses s as an IP Range, returning the result and an error if any. The string s can be in IPv4 address ("192.0.2.1"), IPv4 range ("192.0.2.0-192.0.2.10") IPv4 CIDR ("192.0.2.0/24"), IPv4 subnet mask ("192.0.2.0/255.255.255.0"), IPv6 address ("2001:db8::1"), IPv6 range ("2001:db8::-2001:db8::10"), or IPv6 CIDR ("2001:db8::/64") form. IPv4 CIDR, IPv4 subnet mask and IPv6 CIDR ranges don't include network and broadcast addresses.
func ParseRanges ¶
ParseRanges parses s as a space separated list of IP Ranges, returning the result and an error if any. IP Range can be in IPv4 address ("192.0.2.1"), IPv4 range ("192.0.2.0-192.0.2.10") IPv4 CIDR ("192.0.2.0/24"), IPv4 subnet mask ("192.0.2.0/255.255.255.0"), IPv6 address ("2001:db8::1"), IPv6 range ("2001:db8::-2001:db8::10"), or IPv6 CIDR ("2001:db8::/64") form. IPv4 CIDR, IPv4 subnet mask and IPv6 CIDR ranges don't include network and broadcast addresses.