Expand description
§Service Discovery and Information
Tracks every service Mountain talks to: its lifecycle state, performance counters, dependency graph, and (optionally) a network endpoint. Used by the in-process service registry to make health- based routing decisions.
Layout (one export per file, file name = identity):
ServiceState::Enum- Running / Degraded / Stopped / Error / Starting / ShuttingDown.ServicePerformance::Struct- request/error counters + rolling mean response latency.ServiceEndpoint::Struct- protocol/host/port (+ UDS path).ServiceInfo::Struct- the per-service descriptor.ServiceRegistry::Struct- discovery-cadence-aware map keyed by service name.
TODO: zero callers as of 2026-05-02. Pending wire-up from the gRPC and Tauri IPC dispatch hot paths.
Modules§
- Service
Endpoint - Network endpoint metadata: protocol, host, port, optional Unix-domain
socket path.
NewUnixis the convenience constructor for the UDS-only path; everything else uses the four-argnew. - Service
Info - Per-service descriptor: name, version, lifecycle state, performance counters, dependency list, optional endpoint. Health is the conjunction of operational state, recent heartbeat (≤ 30s), and error rate ≤ 10 %.
- Service
Performance - Per-service request/error counters and a rolling-mean response
latency.
RecordRequestupdates the running average using(prev * (n-1) + new) / nso the value stays bounded under high request volume. - Service
Registry - Map of registered services keyed by name + a configurable discovery
cadence.
ShouldDiscoverreturns true once the configured interval has elapsed since the lastMarkDiscovery(orRegister/Unregister, both of which stamp the timestamp implicitly). - Service
State - Lifecycle state of a service.
IsOperationalcovers the three states a caller can still send work to (Running / Degraded / Starting); the rest are terminal or transitional.