Documentation
¶
Index ¶
Constants ¶
const MaxNoteBytes = 10 * 1024 * 1024
MaxNoteBytes caps the size of a single note body. Decision: 10 MB. Requests larger than this get a 413. The ceiling keeps us well below any SQLite single-row limit while accommodating very long design docs.
Variables ¶
This section is empty.
Functions ¶
func NewRouter ¶
func NewRouter(st *store.Store, prov llm.Provider, emb *embedder.Embedder, cfg *config.Config, registry *project.Registry) http.Handler
NewRouter builds the single http.ServeMux with all routes.
Phase-1 signature change: takes a *project.Registry so the project middleware can resolve ?project= / X-Project on every /api/* and /mcp request. Passing a nil registry is tolerated (the middleware still attaches the default slug to the context) so tests that only exercise docs handlers don't need to spin up a real registry.
func ProjectFromContext ¶
ProjectFromContext returns the project slug stored on the request context. If no middleware ran (ctx is plain), returns the empty string. Handlers should treat empty as "fall back to cfg.DefaultProject" for defensive robustness.
func RequestIDFromContext ¶
RequestIDFromContext returns the ID attached by loggingMiddleware. Empty string when called from a context that never hit the middleware (e.g. a direct handler call from a test that skips the router wrapper).
func SetBuildInfo ¶
func SetBuildInfo(version, commit string)
SetBuildInfo lets cmd/ wire the binary version + commit into the docsiq_build_info gauge. Safe to call from init or main; zero-value defaults ("dev"/"unknown") are used if never called.
Types ¶
This section is empty.