Skip to main content

Module service

Module service 

Source
Expand description

Service launch surfaces with local-only endpoint exposure.

Provides service configuration and health endpoint definitions that enforce binding to 127.0.0.1 only (never 0.0.0.0).

§Security Model

  • All services bind to 127.0.0.1 (localhost) only
  • No external interface exposure
  • Health endpoints at /health respond with HTTP 200 within 30 seconds

§Health Endpoints

Each service registers http://127.0.0.1:<port>/health which returns:

  • HTTP 200 with JSON body {"status": "ok"} when healthy
  • HTTP 503 with JSON body {"status": "unhealthy"} when not healthy

This module does not start an actual HTTP server — it provides the configuration, address binding logic, and health check structures used by the runtime to manage services.

Structs§

HealthCheckResult
Result of a health check against a service.
ServiceConfig
Configuration for a managed service.
ServiceRegistry
Registry of managed services with their configurations.

Enums§

ServiceError
Errors related to service management.

Constants§

HEALTH_PATH
Default health check path.
HEALTH_TIMEOUT
Default health check timeout (30 seconds).
LOCALHOST
Localhost IPv4 address — the only address services may bind to.

Functions§

is_localhost_addr
Validate that a socket address is localhost only.
validate_bind_address
Validate that a bind address string represents a localhost-only address.