Documentation
¶
Overview ¶
Package netlists implements helpers to work with IP address lists.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidCIDR = errors.New("invalid CIDR") ErrInvalidMaskLength = errors.New("invalid mask size bits") )
Functions ¶
This section is empty.
Types ¶
type CIDR ¶
type CIDR interface { IsIP4() bool IsIP6() bool // MaskLength returns the mask size in bits. // // For IPv4, the returned value is `>=0 && <=32`. // // For IPv6, the returned value is `>=0 && <=128`. MaskLength() int // IPString returns only the IP component as a string. IPString() string String() string WithMaskLength(maskLength int) (CIDR, error) // contains filtered or unexported methods }
Click to show internal directories.
Click to hide internal directories.