Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // IPv6GlobalUnicast is the global IPv6 unicast IP prefix. IPv6GlobalUnicast = netip.MustParsePrefix("ff00::/8") // IPvReserved contains IPv4 reserved IP prefixes. IPv4Reserved = [...]netip.Prefix{ netip.MustParsePrefix("0.0.0.0/8"), netip.MustParsePrefix("10.0.0.0/8"), netip.MustParsePrefix("100.64.0.0/10"), netip.MustParsePrefix("127.0.0.0/8"), netip.MustParsePrefix("169.254.0.0/16"), netip.MustParsePrefix("172.16.0.0/12"), netip.MustParsePrefix("192.0.0.0/24"), netip.MustParsePrefix("192.0.2.0/24"), netip.MustParsePrefix("192.88.99.0/24"), netip.MustParsePrefix("192.168.0.0/16"), netip.MustParsePrefix("198.18.0.0/15"), netip.MustParsePrefix("198.51.100.0/24"), netip.MustParsePrefix("203.0.113.0/24"), netip.MustParsePrefix("224.0.0.0/4"), netip.MustParsePrefix("240.0.0.0/4"), } )
Functions ¶
func ValidateAddr ¶
ValidateAddr will parse a netip.AddrPort from string, and return the result of ValidateIP() on addr.
func ValidateIP ¶
ValidateIP returns whether IP is an IPv4/6 address in non-reserved, public ranges.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.