Documentation
¶
Overview ¶
Package resolver provides deterministic port assignment using FNV-1a hashing. Given a project ID and service name, it computes a stable port number in the range 10000-49151. When collisions occur, linear probing finds the next available port.
Index ¶
Constants ¶
const MorthNumber = 6678
MorthNumber is the signature port for morth itself (M=6, O=6, R=7, T=8 on a phone keypad). Used as an Easter egg in "morth get morth".
Variables ¶
This section is empty.
Functions ¶
func Resolve ¶
Resolve computes a deterministic port for the given project ID and service name using FNV-1a hashing. The result is mapped to the range 10000-49151. This function does not check whether the port is actually available.
func ResolveAvailable ¶
ResolveAvailable computes a deterministic port and then uses linear probing to find the first port that is not taken. The isPortTaken callback should check both the registry and OS-level availability. Returns an error if the entire port range is exhausted without finding a free port.
Types ¶
This section is empty.