Documentation
¶
Overview ¶
Package http is the REST API server that backs `clu web`. It exposes the internal/store surface as JSON over net/http so the web UI (and any other client) can drive the tracker without shelling out.
Layout mirrors internal/store:
server.go Server struct, mux, helpers issues.go /api/issues (list, create, get, patch, close, reopen, claim) labels.go /api/issues/:id/labels deps.go /api/issues/:id/deps comments.go /api/issues/:id/comments checkpoints.go /api/checkpoints/:id/approve|fail meta.go /api/meta, /api/agents, /api/tags
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 REST API bound to a single Store. Construct with New, then call Start(ctx) before serving so the change-stream broker begins polling. Mux returns the routed handler.
func (*Server) Mux ¶
Mux returns the routed handler. Routes use Go 1.22 method-aware patterns ("GET /api/issues", "PATCH /api/issues/{id}"); the package requires Go ≥ 1.22, which the project already uses (see go.mod).
func (*Server) Start ¶
Start launches background goroutines (currently: the change-stream poll loop that fans out to /api/events subscribers). They exit when ctx is cancelled. Idempotent for tests is not guaranteed — call once per server lifetime.
func (*Server) WithTemplatesDir ¶
WithTemplatesDir tells the server where to load workflow templates from. Defaults to disabled — /api/templates returns 503 until set. Wired by the CLI from `<project-dir>/templates`.