class

AptLarder::Admin::Api

Inherits Reference / Object

Handles all /api/* requests, returning JSON responses.

Each endpoint operates directly on the shared Cache and Proxy instances — no locking beyond what those classes already provide.

Endpoints

| Method | Path | Description | |--------|------|-------------| | GET | /api/health | Server status and version | | GET | /api/stats | Cumulative proxy counters | | GET | /api/cache | Paginated cache entry list | | DELETE | /api/cache | Flush the entire cache | | DELETE | /api/cache/:key | Invalidate one entry (URL-encoded key) | | POST | /api/evict | Run eviction with optional max_age_days |

Constants

Log = ::Log.for("apt-larder.admin")

Constructors

new(cache : Cache, proxy : Proxy, default_evict_days : Int32 = 30)
Source

Instance methods

handle(ctx : HTTP::Server::Context) : Nil

Routes the request to the appropriate handler.

Source