Documentation
¶
Index ¶
- Variables
- func Cmp(ip1, ip2 net.IP) int
- func ContainsIP(version types.IPVersion, subnet string, ip string) (bool, error)
- func ContainsIPRange(version types.IPVersion, subnet string, ipRange string) (bool, error)
- func IPsDiffSet(ips1, ips2 []net.IP) []net.IP
- func IsCIDR(version types.IPVersion, subnet string) error
- func IsCIDROverlap(version types.IPVersion, subnet1, subnet2 string) (bool, error)
- func IsIP(version types.IPVersion, s string) error
- func IsIPRange(version types.IPVersion, ipRange string) error
- func IsIPRangeOverlap(version types.IPVersion, ipRange1, ipRange2 string) (bool, error)
- func IsIPVersion(version types.IPVersion) error
- func IsIPv4CIDR(subnet string) bool
- func IsIPv4IPRange(ipRange string) bool
- func IsIPv6CIDR(subnet string) bool
- func IsIPv6IPRange(ipRange string) bool
- func NextIP(ip net.IP) net.IP
- func ParseCIDR(version types.IPVersion, subnet string) (*net.IPNet, error)
- func ParseIP(version types.IPVersion, s string) (*net.IPNet, error)
- func ParseIPRange(version types.IPVersion, ipRange string) ([]net.IP, error)
- func ParseIPRanges(version types.IPVersion, ipRanges []string) ([]net.IP, error)
- func PrevIP(ip net.IP) net.IP
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Cmp ¶
Cmp compares two IPs, returning the usual ordering: ip1 < ip2 : -1 ip1 == ip2 : 0 ip1 > ip2 : 1
func ContainsIP ¶ added in v0.0.5
func ContainsIPRange ¶ added in v0.0.5
func IsCIDROverlap ¶ added in v0.0.5
func IsIPRange ¶ added in v0.0.5
IsIPRange check the format for the given ip range. it can be a single one just like '192.168.1.0', and it also could be an IP range just like '192.168.1.0-192.168.1.10'. Notice: the following formats are invalid 1. '192.168.1.0 - 192.168.1.10', there can not be space between two IP. 2. '192.168.1.1-2001:db8:a0b:12f0::1', the combination with one IPv4 and IPv6 is invalid. 3. '192.168.1.10-192.168.1.1', the IP range must be ordered.
func IsIPRangeOverlap ¶ added in v0.0.6
func IsIPVersion ¶ added in v0.0.5
func IsIPv4CIDR ¶ added in v0.0.5
func IsIPv4IPRange ¶ added in v0.0.5
func IsIPv6CIDR ¶ added in v0.0.5
func IsIPv6IPRange ¶ added in v0.0.5
func ParseIPRange ¶ added in v0.0.5
func ParseIPRanges ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.