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

MethodPathDescription
GET/api/healthServer status and version
GET/api/statsCumulative proxy counters
GET/api/cachePaginated cache entry list
DELETE/api/cacheFlush the entire cache
DELETE/api/cache/:keyInvalidate one entry (URL-encoded key)
POST/api/evictRun 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