api

package
v0.0.0-beta.31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
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

func ProjectFromContext(ctx context.Context) string

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

func RequestIDFromContext(ctx context.Context) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL