Documentation
¶
Overview ¶
Package registry manages a shared file-based registry of running xpo board instances so peers can discover each other.
All instances are peers — there is no master. Each instance writes its {name, port, pid, root_dir, started_at} entry on startup and removes it on clean shutdown. Stale entries (process no longer alive) are pruned whenever the registry is read.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindFreePort ¶
FindFreePort tries to bind a TCP listener starting at startPort, incrementing up to maxAttempts-1 times. Returns the listener and the port actually bound.
func Register ¶
Register adds the current process to the registry. Stale entries and any existing entry for this PID are removed first.
func UnregisterByPID ¶
UnregisterByPID removes the entry for the given PID, if any.