port

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoAvailablePort = errors.New("no available port in range")

ErrNoAvailablePort is returned when all ports in the range are occupied.

Functions

func Compute

func Compute(project, service string, containerPort uint16, used map[uint16]struct{}) (uint16, error)

Compute returns a deterministic host port in [10000, 60000) derived from the project name, service name, and container port using FNV-1a hashing. If the initial slot collides with a member of used, it increments until a free slot is found. Returns ErrNoAvailablePort if all slots are occupied.

Types

This section is empty.

Jump to

Keyboard shortcuts

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