Documentation ¶
Overview ¶
The ip package contains yet another IP address (and CIDR) type :-). The types differ from the ones in the net package in that they are backed by fixed-sized arrays of the appropriate size. The key advantage of using a fixed-size array is that it makes the types hashable so they can be used as map keys. In addition, they can be converted to net.IP by slicing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addr ¶
type Addr interface { // Version returns the IP version; 4 or 6. Version() uint8 // AsNetIP returns a net.IP, which is backed by/shares storage with // this object. AsNetIP() net.IP AsCalicoNetIP() calinet.IP String() string }
Addr represents either an IPv4 or IPv6 IP address.
func FromString ¶
type CIDR ¶
type CIDR interface { Version() uint8 Addr() Addr Prefix() uint8 String() string ToIPNet() net.IPNet }
func CIDRFromCalicoNet ¶
func CIDRFromIPNet ¶
func MustParseCIDR ¶
Click to show internal directories.
Click to hide internal directories.