Documentation
¶
Index ¶
- Constants
- func CheckDualStackForKubeComponents(cidrs []net.IPNet, networkType string) error
- func GetBitLen(address string) (int, error)
- func GetByIPFamily(cidrs []net.IPNet, ipFamily string) []net.IPNet
- func Join(cidrs []net.IPNet, sep string) string
- func JoinByComma(cidrs []net.IPNet) string
- func OverLapAny(nw net.IPNet, otherNws ...net.IPNet) bool
- func Overlap(a, b net.IPNet) bool
- func SuggestPort(listenHost string) (port int, resolvedHost string, err error)
Constants ¶
const ( // IPv4Family represents the IPv4 IP family. IPv4Family = "ipv4" // IPv6Family represents the IPv6 IP family. IPv6Family = "ipv6" )
Variables ¶
This section is empty.
Functions ¶
func CheckDualStackForKubeComponents ¶ added in v1.101.0
CheckDualStackForKubeComponents checks if the given list of CIDRs does not include more than one element of the same IP family.
func GetByIPFamily ¶ added in v1.117.0
GetByIPFamily returns a list of CIDRs that belong to the given IP family.
func Join ¶ added in v1.99.0
Join concatenates the CIDRs of the given networks to create a single string with a custom separator character.
func JoinByComma ¶ added in v1.99.0
JoinByComma concatenates the CIDRs of the given networks to create a single string with comma as separator.
func OverLapAny ¶ added in v1.124.0
OverLapAny checks if any of the given IP networks overlap with the first parameter.
func SuggestPort ¶ added in v1.115.0
SuggestPort suggests an address a process can listen on. It returns a tuple consisting of a free port and the hostname resolved to its IP. It makes sure that new port allocated does not conflict with old ports allocated within 1 minute.
Types ¶
This section is empty.