Commit graph

10 commits

Author SHA1 Message Date
Snider
65ac37d3e7 feat: modernise to Go 1.26 iterators and stdlib helpers
Some checks failed
Security Scan / security (push) Successful in 11s
Test / test (push) Failing after 42s
Add Endpoints and MiddlewareChain iterators on API server, bridge
ResponseFieldsSeq/HeadersSeq. Use strings.SplitSeq in SDK codegen,
slices.SortFunc in OpenAPI spec generation.

Co-Authored-By: Gemini <noreply@google.com>
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-23 05:47:16 +00:00
Snider
303779f527 feat: refactor swagger to use SpecBuilder for runtime OpenAPI generation
Replace the hardcoded Swagger 2.0 JSON template with SpecBuilder-backed
OpenAPI 3.1 generation. The swagger spec is now built lazily from
registered RouteGroups (including DescribableGroup and ToolBridge
endpoints) and cached via sync.Once. Uses unique swag instance names
to avoid global registry collisions in tests.

Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:53:37 +00:00
Snider
f5d2f45b94 feat: add WithExpvar runtime metrics endpoint
Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:20:31 +00:00
Snider
32b3680402 feat: add WithPprof runtime profiling endpoints
Registers Go pprof handlers at /debug/pprof/ via gin-contrib/pprof
when the WithPprof() option is enabled. Uses the same flag-in-build()
pattern as WithSwagger() — routes are only mounted when explicitly
opted in.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 00:18:05 +00:00
Snider
d517fa2d71 feat: add WithGraphQL endpoint and playground support
Mount a gqlgen ExecutableSchema as a Gin handler at /graphql with
optional playground UI at /graphql/playground. Supports custom path
via WithGraphQLPath().

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 00:12:25 +00:00
Snider
8fc307b454 feat: add WithSSE server-sent events support
Add SSEBroker type that manages SSE client connections and broadcasts
events to subscribed clients. Clients connect via GET /events and
optionally filter by channel with ?channel=<name>. Includes Publish,
ClientCount, and Drain methods for event broadcasting and lifecycle
management.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 00:01:04 +00:00
Snider
095c38a8c4 feat: add Swagger UI endpoint with runtime spec serving
Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:56:29 +00:00
Snider
22f8a6915c feat: add WebSocket endpoint and channel listing from StreamGroups
Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:53:10 +00:00
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