Documentation
¶
Overview ¶
Package httpapi is the v0.2 production API for non-Go producers (ADR-0008): enqueue tasks and read queue stats over HTTP with token auth. Unlike the read-only dashboard (`tq serve`), this surface WRITES, so the token is mandatory on every bind (no loopback exemption: API servers are meant to be exposed to other machines).
The surface is queue-metadata-only by design (TODO row verified 2026-09-28): enqueue, per-status counts, and health — no per-task reads, so derived outcomes (agent results, review/status verdicts, session usage) remain dashboard surfaces (`tq serve` detail pages, `tq show`).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the write API over one store.
func New ¶
New builds a Server. token must be non-empty: the API refuses to start without one (fail closed, unlike the dashboard's loopback exemption).
func (*Server) ListenAndServe ¶
ListenAndServe starts the API on addr (e.g. "127.0.0.1:8091") until ctx is cancelled. It owns the read model's lifetime when UseReadModel ran: the pump tails the journal for the whole serve window and the projection closes after the HTTP server has fully stopped.
func (*Server) UseReadModel ¶ added in v0.3.1
UseReadModel moves the stats read onto the ADR-0019 S3 metaengine read model at path (readmodel.PathFor derives it beside the queue db): the projection folds the journal and GET /api/v1/stats reads its planned table. The enqueue side is untouched — the model is read-only over the store. ListenAndServe owns the model's pump and lifetime; ctx covers the durable-cursor load at setup.