netutil

package
v0.0.0-...-4064606 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2020 License: Apache-2.0, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package netutil implements network-related utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultHost

func GetDefaultHost() (string, error)

GetDefaultHost obtains the first IP address of machine from the routing table and returns the IP address as string. An IPv4 address is preferred to an IPv6 address for backward compatibility.

func GetDefaultInterfaces

func GetDefaultInterfaces() (map[string]uint8, error)

GetDefaultInterfaces gets names of interfaces and returns a map[interface]families.

func IsNetworkTimeoutError

func IsNetworkTimeoutError(err error) bool

func URLStringsEqual

func URLStringsEqual(ctx context.Context, lg *zap.Logger, a []string, b []string) (bool, error)

URLStringsEqual returns "true" if given URLs are valid and resolved to same IP addresses. Otherwise, return "false" and error, if any.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL