Documentation
¶
Index ¶
Constants ¶
View Source
const ( IPv4BitSize = 32 IPv6BitSize = 128 IPv4DefaultMaskingBitSize = 24 IPv6DefaultMaskingBitSize = 56 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPValidator ¶
type IPValidator interface {
// IsValid returns true when an IP address is determined to be valid.
IsValid(net.IP, IPVersion) bool
}
IPValidator is the interface for validating an ip address and version.
type IPVersion ¶
type IPVersion int
IPVersion is the numerical version of the IP address spec (4 or 6).
type PublicNetworkIPValidator ¶
type PublicNetworkIPValidator struct {
IPv4PrivateNetworks []net.IPNet
IPv6PrivateNetworks []net.IPNet
}
PublicNetworkIPValidator validates an ip address which is not contained in the list of known private networks.
type VersionIPValidator ¶
type VersionIPValidator struct {
Version IPVersion
}
VersionIPValidator validates an ip address based on the desired ip version.
Click to show internal directories.
Click to hide internal directories.