Documentation
¶
Overview ¶
Package launcher tracks running per-project Interseptor instances so a single dashboard process can start/stop/discover them: the registry is a small JSON file (~/.interseptor/instances.json) mapping project name to {controlAddr, proxyAddr, pid}, written by whichever process spawns an instance and pruned lazily via Reconcile.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindFreePort ¶
FindFreePort returns the first TCP port in [start, start+span) that is not in used and can actually be bound on host right now, verified by a real listen-then-close probe — not just absence from used — so a port already held by an unrelated process is skipped too.
Types ¶
type Instance ¶
type Instance struct {
Project string `json:"project"`
Dir string `json:"dir,omitempty"`
ControlAddr string `json:"controlAddr"`
ProxyAddr string `json:"proxyAddr"`
PID int `json:"pid"`
StartedAt string `json:"startedAt,omitempty"`
}
Instance is one running project's control-plane/proxy addresses and pid.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a mutex-guarded, disk-backed set of running instances keyed by project name. Safe for concurrent use.
func Open ¶
Open loads path if it exists; a missing or corrupt file yields an empty, otherwise-usable registry rather than an error, since a stale/garbled registry shouldn't block the launcher from starting.
func (*Registry) Reconcile ¶
Reconcile drops entries whose process is no longer alive, as judged by isAlive (injected so tests don't depend on real OS process state).