Documentation
¶
Overview ¶
Package api implements the chi v5 HTTP routes for /api/v1 (SPEC-07) and the OpenAPI 3.1 source-of-truth with a CI route diff.
M1: package skeleton only (this doc.go). M10 lands the routes (health, version, search, explain, validate, assets/{id}[/history], sources, rules, server status/stop), token auth (hashed at rest), scopes, rate-limit headers, request IDs (UUIDv7), standard envelope + API_E_* codes.
The api package depends on internal/search (the SearchService) and internal/config; it never imports any collector or egress package (ADR-0010; AC-3.1 import-graph test).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// TokenHash is the SHA-256 hex digest of the configured API token;
// "" means token auth is DISABLED — the server must then bind
// loopback only (enforced by the cmd wiring before ListenAndServe).
TokenHash string
// RateLimit is requests per minute per client IP (0 = default 120).
RateLimit int
// TrustedProxies are the CIDRs whose X-Forwarded-For header the
// API may honor for client-IP resolution (M16). Empty (the
// default) = peer address only; the header is ignored.
TrustedProxies []netip.Prefix
// contains filtered or unexported fields
}
Server is the REST API.
Click to show internal directories.
Click to hide internal directories.