network

package
v0.260224.1130 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAvailablePort

func GetAvailablePort(min, max int) (int, error)

GetAvailablePort returns an available port in the range [min, max]

func IsPortAvailable

func IsPortAvailable(port int) bool

IsPortAvailable checks if a port is available for listening

func IsPortAvailableWithInfo

func IsPortAvailableWithInfo(host string, port int) (available bool, info string)

IsPortAvailableWithInfo checks if a port is available and returns detailed info

func ResolveHost

func ResolveHost(host string) string

ResolveHost resolves the host to an IP address or returns it as-is if it's already an IP or localhost

func WaitForPortAvailable

func WaitForPortAvailable(port int, timeout time.Duration) error

WaitForPortAvailable waits until the port becomes available or timeout occurs

Types

This section is empty.

Jump to

Keyboard shortcuts

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