Commit graph

5 commits

Author SHA1 Message Date
Snider
d21734d8d9 feat: add bearer auth, request ID, and CORS middleware
Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:49:35 +00:00
Snider
db75c88d58 feat: add Engine with Register, Handler, Serve, and graceful shutdown
Engine manages route groups and builds a Gin-based HTTP handler.
New() accepts functional options (WithAddr). Handler() builds a fresh
Gin engine with Recovery middleware and /health endpoint. Serve()
starts the server and performs graceful shutdown on context cancellation.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 15:46:11 +00:00
Snider
6f5fb69944 feat: add RouteGroup and StreamGroup interfaces
RouteGroup declares Name, BasePath, and RegisterRoutes for subsystems
to mount their endpoints onto a Gin router group. StreamGroup optionally
declares WebSocket channel names. Gin v1.11.0 added as dependency.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 15:44:58 +00:00
Snider
7835837e38 feat: add response envelope with OK, Fail, Paginated helpers
Generic Response[T] envelope with Success, Data, Error, and Meta fields.
Includes OK, Fail, FailWithDetails, and Paginated constructor functions.
JSON marshalling correctly omits empty fields via omitempty tags.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 15:44:17 +00:00
Snider
889391a3a7 chore: scaffold go-api module
EUPL-1.2 licence, module path forge.lthn.ai/core/go-api.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 15:42:16 +00:00