net

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package net provides network utilities extending the standard net package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FreePort

func FreePort(ctx context.Context) (int, error)

FreePort returns a free port on localhost

func FreePorts added in v0.11.0

func FreePorts(ctx context.Context, n int) ([]int, error)

FreePorts returns a free port on localhost

func IsFreePort added in v0.11.0

func IsFreePort(ctx context.Context, port int) error

IsFreePort checks if a specific port is available on localhost

func WaitFor added in v0.11.0

func WaitFor(ctx context.Context, network, address string, timeout time.Duration) error

WaitFor attempts to establish a connection to the specified address until the timeout or context cancellation occurs.

func WaitForFreePort added in v0.11.0

func WaitForFreePort(ctx context.Context, port int, timeout time.Duration) error

WaitForFreePort attempts to establish a TCP connection to the specified address until the timeout or context cancellation occurs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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