Documentation
¶
Index ¶
- func AssignRandPort(ip ...string) (int, error)
- func ExternalIP() (string, error)
- func ExtractIP(addr net.Addr) (string, error)
- func ExtractPort(addr net.Addr) (int, error)
- func FulfillAddr(addr string) string
- func IP2Long(ip string) uint32
- func InternalIP() (string, error)
- func Long2IP(v uint32) string
- func PrivateIP() (string, error)
- func PublicIP() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignRandPort ¶
AssignRandPort allocates a free random port, optionally bound to one of the given IP addresses.
func ExtractPort ¶
ExtractPort extracts the host port from addr.
func FulfillAddr ¶
FulfillAddr completes addr so that it is a valid, fully qualified address.
func IP2Long ¶ added in v2.1.0
IP2Long converts an IPv4 address into its uint32 representation. It returns 0 when ip is not a valid IPv4 address.
func InternalIP ¶
InternalIP returns the internal (private) IP address.
func Long2IP ¶ added in v2.1.0
Long2IP converts a uint32 into its dotted-decimal IPv4 address string.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.