go-api/options.go
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

13 lines
265 B
Go

// SPDX-License-Identifier: EUPL-1.2
package api
// Option configures an Engine during construction.
type Option func(*Engine)
// WithAddr sets the listen address for the server.
func WithAddr(addr string) Option {
return func(e *Engine) {
e.addr = addr
}
}