Documentation ¶
Index ¶
- func IsDualStackCIDRStrings(cidrs []string) (bool, error)
- func IsDualStackCIDRs(cidrs []*net.IPNet) (bool, error)
- func IsDualStackIPStrings(ips []string) (bool, error)
- func IsDualStackIPs(ips []net.IP) (bool, error)
- func IsIPv6(netIP net.IP) bool
- func IsIPv6CIDR(cidr *net.IPNet) bool
- func IsIPv6CIDRString(cidr string) bool
- func IsIPv6String(ip string) bool
- func ParseCIDRs(cidrsString []string) ([]*net.IPNet, error)
- type IPNetSet
- func (s IPNetSet) Delete(items ...*net.IPNet)
- func (s IPNetSet) Difference(s2 IPNetSet) IPNetSet
- func (s IPNetSet) Equal(s2 IPNetSet) bool
- func (s IPNetSet) Has(item *net.IPNet) bool
- func (s IPNetSet) HasAll(items ...*net.IPNet) bool
- func (s IPNetSet) Insert(items ...*net.IPNet)
- func (s IPNetSet) IsSuperset(s2 IPNetSet) bool
- func (s IPNetSet) Len() int
- func (s IPNetSet) StringSlice() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDualStackCIDRStrings ¶
IsDualStackCIDRStrings returns if - all are valid cidrs - at least one cidr from each family (v4 or v6)
func IsDualStackCIDRs ¶
IsDualStackCIDRs returns if - all are valid cidrs - at least one cidr from each family (v4 or v6)
func IsDualStackIPStrings ¶
IsDualStackIPStrings returns if - all are valid ips - at least one ip from each family (v4 or v6)
func IsDualStackIPs ¶
IsDualStackIPs returns if a slice of ips is: - all are valid ips - at least one ip from each family (v4 or v6)
func IsIPv6CIDRString ¶
IsIPv6CIDRString returns if cidr is IPv6. This assumes cidr is a valid CIDR.
Types ¶
type IPNetSet ¶
IPNetSet maps string to net.IPNet.
func ParseIPNets ¶
ParseIPNets parses string slice to IPNetSet.
func (IPNetSet) Delete ¶
Delete removes all items from the set.
func (IPNetSet) Difference ¶
Difference returns a set of objects that are not in s2 For example: s1 = {a1, a2, a3} s2 = {a1, a2, a4, a5} s1.Difference(s2) = {a3} s2.Difference(s1) = {a4, a5}
func (IPNetSet) Equal ¶
Equal returns true if and only if s1 is equal (as a set) to s2. Two sets are equal if their membership is identical. (In practice, this means same elements, order doesn't matter)
func (IPNetSet) Has ¶
Has returns true if and only if item is contained in the set.
func (IPNetSet) HasAll ¶
HasAll returns true if and only if all items are contained in the set.
func (IPNetSet) Insert ¶
Insert adds items to the set.
func (IPNetSet) IsSuperset ¶
IsSuperset returns true if and only if s1 is a superset of s2.