Documentation
¶
Overview ¶
Package gin is the mAPI-ng adapter for the Gin web framework. Its only job is to extract, after each request completes, the two things the Core needs — the registered route template (never the raw path) and the final status code — and call the Recorder's Observe. Only this package imports Gin, so a non-Gin user never pulls Gin into their binary (docs/context.md → Adapter).
Registration order matters: register this middleware ABOVE gin.Recovery() so that when Recovery converts a panic into a 500, this middleware simply observes that 500. The middleware deliberately does NOT recover panics itself — it observes host behavior, it never alters it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(opts ...maping.Option) gin.HandlerFunc
Middleware creates a Recorder from the given options and returns a Gin handler that observes each request. With no ingest key resolved the Recorder is a no-op, so this is always safe to add (zero-config). The returned handler does not expose the Recorder, so it cannot be shut down; use MiddlewareWithRecorder when the host needs to manage the lifecycle.
func MiddlewareWithRecorder ¶
func MiddlewareWithRecorder(rec *maping.Recorder) gin.HandlerFunc
MiddlewareWithRecorder returns a Gin handler bound to a caller-owned Recorder, so the host controls its lifecycle and can call Shutdown (after http.Server.Shutdown).
Types ¶
This section is empty.