netutil

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListenAddress

type ListenAddress struct {
	Raw          string
	Host         string
	Port         int
	HostExplicit bool
	HostWildcard bool
	HostLoopback bool
}

ListenAddress describes a parsed host:port listener with bind classification.

func ParseListenAddress

func ParseListenAddress(addr string) (ListenAddress, error)

ParseListenAddress parses a port-only, :port, or host:port listener string.

func PreferredAdvertisedListenAddress

func PreferredAdvertisedListenAddress(primaryAddr, legacyAddr string) (ListenAddress, error)

PreferredAdvertisedListenAddress returns the listener surfaced on public discovery endpoints, preferring the legacy listener when configured.

func (ListenAddress) ExplicitAdvertisedHost

func (a ListenAddress) ExplicitAdvertisedHost() string

ExplicitAdvertisedHost returns the configured explicit host when the listener is not wildcard-bound.

func (ListenAddress) ExposesNonLoopback

func (a ListenAddress) ExposesNonLoopback() bool

ExposesNonLoopback reports whether the listener is reachable beyond loopback.

Jump to

Keyboard shortcuts

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