package netutil
import "go.etcd.io/etcd/pkg/v3/netutil"
Package netutil implements network-related utility functions.
Index ¶
- func GetDefaultHost() (string, error)
- func GetDefaultInterfaces() (map[string]uint8, error)
- func IsNetworkTimeoutError(err error) bool
- func URLStringsEqual(ctx context.Context, lg *zap.Logger, a []string, b []string) (bool, error)
Functions ¶
func GetDefaultHost ¶
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 ¶
GetDefaultInterfaces gets names of interfaces and returns a map[interface]families.
func IsNetworkTimeoutError ¶
func URLStringsEqual ¶
URLStringsEqual returns "true" if given URLs are valid and resolved to same IP addresses. Otherwise, return "false" and error, if any.
Source Files ¶
doc.go netutil.go routes_linux.go
- Version
- v3.5.18 (latest)
- Published
- Jan 24, 2025
- Platform
- linux/amd64
- Imports
- 13 packages
- Last checked
- 6 days ago –
Tools for package owners.