Documentation
¶
Index ¶
- Variables
- func GetAddrs() ([]string, error)
- func GetAllInterfaces() ([]string, error)
- func GetFreeTCPPort() (int, error)
- func GetFreeUDPPort() (int, error)
- func GetHostIP() (string, error)
- func GetInterfaceByIP(ip string) (*net.Interface, error)
- func GetInterfaceByName(name string) (*net.Interface, error)
- func GetNonLoopbackAddrs() ([]string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned when the requested item is not found. ErrNotFound = errors.New("Not found") // ErrInvalidParam is returned when the parameter is invalid. ErrInvalidParam = errors.New("Invalid parameter") )
Functions ¶
func GetAllInterfaces ¶ added in v0.2.0
GetInterface returns the interface with the given name or IP address.
func GetFreeTCPPort ¶ added in v0.2.1
GetTCPFreePort returns an available TCP port number.
func GetFreeUDPPort ¶ added in v0.2.1
GetUDPFreePort returns an available UDP port number.
func GetHostIP ¶ added in v0.2.0
GetHostIP returns the primary IP address of the host. It returns the first non-loopback IPv4 address if available, otherwise the first non-loopback IPv6 address.
func GetInterfaceByIP ¶ added in v0.2.0
GetInterfaceByIP returns the interface with the given IP address.
func GetInterfaceByName ¶ added in v0.2.0
GetInterfaceByName returns the interface with the given name.
func GetNonLoopbackAddrs ¶ added in v0.2.0
GetNonLoopbackAddrs returns all non-loopback IP addresses.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.