netx

package
v3.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 4 Imported by: 0

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

func ConnectableAddr(addr net.Addr) net.Addr

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

func ConnectableString(addr net.Addr) string

ConnectableString is a convenience wrapper that returns ConnectableAddr(addr).String().

func LoopbackIP added in v3.3.0

func LoopbackIP(ip net.IP) net.IP

LoopbackIP returns the loopback IP address for the given IP address.

func SetupListenerFactory

func SetupListenerFactory(name, address string) func(lc *lifecycle.Lifecycle) (net.Listener, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL