Documentation ¶
Index ¶
- func AddressesDefault(preferIPv6 bool, af AddressFilter) ([]net.IP, error)
- func AddressesRouting(vips []net.IP, af AddressFilter, preferIPv6 bool) ([]net.IP, error)
- func AlarmStabilization(cur_alrm bool, cur_defect bool, consecutive_ctr uint8, on_threshold uint8, ...) (bool, uint8)
- func ConvertIpsToStrings(ips []net.IP) []string
- func CreateFileWatcher(log logrus.FieldLogger, fileName string) (*fsnotify.Watcher, error)
- func FletcherChecksum8(inp string) uint8
- func GetClientConfig(kubeApiServerUrl, kubeconfigPath string) (*rest.Config, error)
- func GetFileMd5(filePath string) (string, error)
- func GetInterfaceWithCidrByIP(ip net.IP, strictMatch bool) (*net.Interface, *net.IPNet, error)
- func GetLocalCIDRByIP(ip string) (string, error)
- func IpInCidr(ipAddr, cidr string) (bool, error)
- func IsIPv4(ip net.IP) bool
- func IsIPv6(ip net.IP) bool
- func IsKubernetesHealthy(port uint16) (bool, error)
- func IsNetIPv6(network net.IPNet) bool
- func Mapper[T, U any](data []T, f func(T) U) []U
- func RunWatcher(log logrus.FieldLogger, watcher *fsnotify.Watcher, fileName string) (bool, error)
- func SetDebugLogLevel()
- func ShortHostname() (shortName string, err error)
- func SplitCIDR(s string) (string, string, error)
- func ValidNodeAddress(address netlink.Addr) bool
- func ValidOVNNodeAddress(address netlink.Addr) bool
- type AddressFilter
- type FoundAddress
- type RouteFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddressesDefault ¶
func AddressesDefault(preferIPv6 bool, af AddressFilter) ([]net.IP, error)
AddressesDefault returns a slice of configured addresses in the current network namespace associated with default routes; IPv4 first (if any), then IPv6 (if any). You can optionally pass an AddressFilter to further filter down which addresses are considered
func AddressesRouting ¶
AddressesRouting takes a slice of Virtual IPs and returns a configured address in the current network namespace that directly routes to at least one of those vips. If the interface containing that address is dual-stack, it will also return a single address of the opposite IP family. You can optionally pass an AddressFilter to further filter down which addresses are considered
func AlarmStabilization ¶
func ConvertIpsToStrings ¶
func CreateFileWatcher ¶
func CreateFileWatcher(log logrus.FieldLogger, fileName string) (*fsnotify.Watcher, error)
func FletcherChecksum8 ¶
func GetClientConfig ¶
getClientConfig returns a Kubernetes client Config.
func GetFileMd5 ¶
func GetInterfaceWithCidrByIP ¶
GetInterfaceWithCidrByIP returns the interface and network that has the passed IP address configured. It allows to run in a non-strict mode in which it's not required to match the exact IP address but only a subnet.
E.g. for interface configured as "192.168.1.1/24" strict mode asked about "192.168.1.2" returns FALSE whereas in non-strict mode it returns TRUE.
func GetLocalCIDRByIP ¶
func IsKubernetesHealthy ¶
func RunWatcher ¶
func RunWatcher(log logrus.FieldLogger, watcher *fsnotify.Watcher, fileName string) (bool, error)
func SetDebugLogLevel ¶
func SetDebugLogLevel()
func ShortHostname ¶
func ValidNodeAddress ¶
ValidNodeAddress returns true if the address is suitable for a node's primary IP
func ValidOVNNodeAddress ¶
ValidOVNNodeAddress returns true if the address is suitable for a node's primary IP and is not fd69::2 we intentionally don't filter ipv4 because it isn't necessary.
Types ¶
type AddressFilter ¶
AddressFilter is a function type to filter addresses
type FoundAddress ¶
type RouteFilter ¶
RouteFilter is a function type to filter routes