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.
Click to show internal directories.
Click to hide internal directories.