type IPFamily … const IPFamilyUnknown … const IPv4 … const IPv6 … // IsDualStackIPs returns true if: // - all elements of ips are valid // - at least one IP from each family (v4 and v6) is present func IsDualStackIPs(ips []net.IP) (bool, error) { … } // IsDualStackIPStrings returns true if: // - all elements of ips can be parsed as IPs // - at least one IP from each family (v4 and v6) is present func IsDualStackIPStrings(ips []string) (bool, error) { … } // IsDualStackCIDRs returns true if: // - all elements of cidrs are non-nil // - at least one CIDR from each family (v4 and v6) is present func IsDualStackCIDRs(cidrs []*net.IPNet) (bool, error) { … } // IsDualStackCIDRStrings returns if // - all elements of cidrs can be parsed as CIDRs // - at least one CIDR from each family (v4 and v6) is present func IsDualStackCIDRStrings(cidrs []string) (bool, error) { … } // IPFamilyOf returns the IP family of ip, or IPFamilyUnknown if it is invalid. func IPFamilyOf(ip net.IP) IPFamily { … } // IPFamilyOfString returns the IP family of ip, or IPFamilyUnknown if ip cannot // be parsed as an IP. func IPFamilyOfString(ip string) IPFamily { … } // IPFamilyOfCIDR returns the IP family of cidr. func IPFamilyOfCIDR(cidr *net.IPNet) IPFamily { … } // IPFamilyOfCIDRString returns the IP family of cidr. func IPFamilyOfCIDRString(cidr string) IPFamily { … } // IsIPv6 returns true if netIP is IPv6 (and false if it is IPv4, nil, or invalid). func IsIPv6(netIP net.IP) bool { … } // IsIPv6String returns true if ip contains a single IPv6 address and nothing else. It // returns false if ip is an empty string, an IPv4 address, or anything else that is not a // single IPv6 address. func IsIPv6String(ip string) bool { … } // IsIPv6CIDR returns true if a cidr is a valid IPv6 CIDR. It returns false if cidr is // nil or an IPv4 CIDR. Its behavior is not defined if cidr is invalid. func IsIPv6CIDR(cidr *net.IPNet) bool { … } // IsIPv6CIDRString returns true if cidr contains a single IPv6 CIDR and nothing else. It // returns false if cidr is an empty string, an IPv4 CIDR, or anything else that is not a // single valid IPv6 CIDR. func IsIPv6CIDRString(cidr string) bool { … } // IsIPv4 returns true if netIP is IPv4 (and false if it is IPv6, nil, or invalid). func IsIPv4(netIP net.IP) bool { … } // IsIPv4String returns true if ip contains a single IPv4 address and nothing else. It // returns false if ip is an empty string, an IPv6 address, or anything else that is not a // single IPv4 address. func IsIPv4String(ip string) bool { … } // IsIPv4CIDR returns true if cidr is a valid IPv4 CIDR. It returns false if cidr is nil // or an IPv6 CIDR. Its behavior is not defined if cidr is invalid. func IsIPv4CIDR(cidr *net.IPNet) bool { … } // IsIPv4CIDRString returns true if cidr contains a single IPv4 CIDR and nothing else. It // returns false if cidr is an empty string, an IPv6 CIDR, or anything else that is not a // single valid IPv4 CIDR. func IsIPv4CIDRString(cidr string) bool { … }