port

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGetTCP = errors.New("get tcp address")
	ErrNotIP  = errors.New("provided value isn't a valid ip")
)

Functions

func GetFree

func GetFree(ip ...string) (port int, err error)

GetFree return an available free port to listen on. It use the synthax 'localhost:0' under the hood to attempt to listen on a random port. The list ip, which default to localhost, can be parametrized.

Types

This section is empty.

Jump to

Keyboard shortcuts

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