OTP Application entry point for Aurinko.
Starts and supervises all library processes in dependency order:
Aurinko.Supervisor (one_for_one)
├── Aurinko.Cache ETS-backed TTL response cache
├── Aurinko.RateLimiter Token-bucket rate limiter (per-token + global)
├── Aurinko.CircuitBreaker Per-endpoint circuit breaker state machine
├── Client Req-based HTTP client (depends on above three)
└── Aurinko.Telemetry Telemetry event handler / reporter setupStartup sequence
- Validate config (fail fast with a clear error if credentials are missing).
- Start ETS-owning GenServers (Cache, RateLimiter, CircuitBreaker) first.
- Start the HTTP client, which reads config and builds the Req base request.
- Start Telemetry and optionally attach the default Logger handler.
- Log a structured startup summary.
Shutdown
OTP sends :shutdown to children in reverse start order (Telemetry → HTTP
Client → CircuitBreaker → RateLimiter → Cache). Each GenServer has a 5 s
shutdown timeout to flush in-flight state. The ETS tables owned by Cache,
RateLimiter, and CircuitBreaker are automatically deleted when their owning
process exits.