Documentation
¶
Index ¶
- func HealthCheck(ctx *gin.Context)
- type Router
- func (r *Router) Build() *gin.Engine
- func (r *Router) WithBackchannel(setup func(*gin.Engine)) *Router
- func (r *Router) WithFrontend(setupHydra, setup2FA, setupWebAuthn, setupNotify func(*gin.Engine)) *Router
- func (r *Router) WithHealth(handler gin.HandlerFunc) *Router
- func (r *Router) WithMetricsMiddleware() *Router
- func (r *Router) WithMetricsRoute(handler gin.HandlerFunc) *Router
- func (r *Router) WithRecovery() *Router
- func (r *Router) WithRequestDecompression() *Router
- func (r *Router) WithResponseCompression() *Router
- func (r *Router) WithStatic(setup func(*gin.Engine)) *Router
- func (r *Router) WithTrustedProxies() *Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HealthCheck ¶
HealthCheck handles the health check functionality by logging a message and returning "pong" as the response.
Types ¶
type Router ¶
Router is a small builder around gin.Engine to assemble middlewares and routes without leaking application-specific logic into this package.
func (*Router) WithBackchannel ¶
WithBackchannel registers the backchannel API endpoints via the provided setup function.
func (*Router) WithFrontend ¶
func (r *Router) WithFrontend(setupHydra, setup2FA, setupWebAuthn, setupNotify func(*gin.Engine)) *Router
WithFrontend calls the provided setup functions to register the frontend pages.
func (*Router) WithHealth ¶
func (r *Router) WithHealth(handler gin.HandlerFunc) *Router
WithHealth registers the health endpoint using the given handler.
func (*Router) WithMetricsMiddleware ¶
WithMetricsMiddleware enables Prometheus request metrics middleware.
func (*Router) WithMetricsRoute ¶
func (r *Router) WithMetricsRoute(handler gin.HandlerFunc) *Router
WithMetricsRoute registers the GET /metrics handler provided by the caller.
func (*Router) WithRecovery ¶
WithRecovery adds gin.Recovery middleware to recover from panics.
func (*Router) WithRequestDecompression ¶
WithRequestDecompression installs request decompression middlewares (gzip, zstd, br).
func (*Router) WithResponseCompression ¶
WithResponseCompression applies response compression according to server config.
func (*Router) WithStatic ¶
WithStatic runs the provided setup function to add static routes.
func (*Router) WithTrustedProxies ¶
WithTrustedProxies configures the trusted proxies for the underlying engine.