CodeVetter · Repo Unpack · System map
gin-gonic/gin
Gin is delivered as a Go library embedded in consumer applications. Engine owns routing configuration and pooled request contexts, while binding and render packages implement input and output boundaries. Network serving delegates to net/http or the HTTP/3 integration. Framework state is primarily in memory, with explicit filesystem helpers rather than an application database layer.
- The module is github.com/gin-gonic/gin, declares Go 1.26.0, and directly depends on validator/v10, SSE, QUIC, serialization libraries, and testify.
- New creates a middleware-free Engine; Default calls New and attaches Logger and Recovery before applying OptionFunc values.
- Engine embeds RouterGroup and owns HTML rendering, fallback chains, sync.Pool, method trees, parameter capacities, and trusted-proxy configuration.
- Routing uses methodTree roots and node records carrying path fragments, child indices, wildcard type, handler chains, and full route paths.
- Binding and rendering are separate interfaces: Binding consumes an HTTP request into a caller-owned value, while Render writes to an http.ResponseWriter.
- Engine implements ServeHTTP; Handler optionally wraps it with h2c, and serving helpers support HTTP, TLS, Unix sockets, file descriptors, QUIC, and supplied listeners.
- Request Keys and Errors belong to Context; explicit persistence is exposed through SaveUploadedFile, which copies an uploaded stream to a caller-selected filesystem destination.
- Release configuration skips binary builds; tag-triggered GitHub Actions invokes GoReleaser and requests module reindexing, while the test workflow invokes make test.