Documentation
¶
Overview ¶
Package api implements the v1.3+ REST API. Routes mount under /api/v1. The API is JSON-only, returns a consistent error envelope {"error":"..."} on every non-2xx, supports pagination via ?page + ?per_page query params, and emits ETag headers for cacheable read endpoints so well-behaved clients (and the v1.4 studio UI) skip re-rendering identical responses.
Auth: every route is gated on either a session cookie (browser flows) or a Bearer token with the right scope (machine flows). The Mount() function wires both middlewares; downstream handlers resolve the actor via auth.TokenFromContext + auth.FromContext.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is the surface the daemon mounts onto its chi router. Holds references to the persistence + auth dependencies the handlers need.
func New ¶
New constructs the API handle. The Mount() method wires every route on r under the /api/v1 prefix.