package netutil
import "github.com/coreos/etcd/pkg/netutil"
Package netutil implements network-related utility functions.
Index ¶
- func DropPort(port int) error
- func GetDefaultHost() (string, error)
- func GetDefaultInterfaces() (map[string]uint8, error)
- func IsNetworkTimeoutError(err error) bool
- func RecoverPort(port int) error
- func RemoveLatency() error
- func SetLatency(ms, rv int) error
- func URLStringsEqual(ctx context.Context, a []string, b []string) (bool, error)
Functions ¶
func DropPort ¶
DropPort drops all tcp packets that are received from the given port and sent to the given port.
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 RecoverPort ¶
RecoverPort stops dropping tcp packets at given port.
func RemoveLatency ¶
func RemoveLatency() error
RemoveLatency resets latency configurations.
func SetLatency ¶
SetLatency adds latency in millisecond scale with random variations.
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 ¶
isolate_linux.go netutil.go routes_linux.go
- Version
- v3.3.2+incompatible
- Published
- Mar 8, 2018
- Platform
- linux/amd64
- Imports
- 14 packages
- Last checked
- 4 minutes ago –
Tools for package owners.