Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // IPv4loopback is the loopback IP address for IPv4. IPv4loopback = net.IPv4(127, 0, 0, 1) // IPv6loopback is the loopback IP address for IPv6. IPv6loopback = net.IPv6loopback )
Functions ¶
func ConnectableAddr ¶ added in v3.3.0
ConnectableAddr returns a new net.Addr with unspecified IPs (0.0.0.0, [::]) replaced by the corresponding loopback address (127.0.0.1, [::1]). Non-IP addresses (e.g. Unix sockets) are returned as-is.
func ConnectableString ¶ added in v3.3.0
ConnectableString is a convenience wrapper that returns ConnectableAddr(addr).String().
func LoopbackIP ¶ added in v3.3.0
LoopbackIP returns the loopback IP address for the given IP address.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.