CodeVetter · Repo Unpack · Feature catalog
gin-gonic/gin
The public surface centers on route registration, middleware, request binding, and response rendering. Applications can serve templates and files, accept uploads, stream events, and manage cookies. Authentication and observability helpers ship alongside the core routing API. These are framework capabilities; the inspected routes in documentation and tests are examples supplied by consumers.
- RouterGroup supports method shortcuts, custom uppercase methods through Handle, grouped prefixes and middleware, Any, and multi-method Match registration.
- QUERY has a separate IQueryRoutes interface to preserve IRoutes compatibility; Any retains nine existing methods and excludes QUERY.
- Input binding supports JSON, XML, forms, query, multipart, protobuf, MessagePack, YAML, URI, headers, plain bodies, TOML, and BSON, with automatic method/content-type selection.
- Context offers JSON variants, XML, PDF byte responses, YAML, TOML, protobuf, BSON, strings, and redirects; MessagePack rendering is compiled only without nomsgpack.
- HTML templates can load from globs, explicit files, or http.FileSystem patterns, with configurable delimiters and template functions.
- StaticFile and StaticFS register GET and HEAD routes; Context additionally exposes uploaded-file extraction, multipart access, filesystem saving, and attachment responses.
- SSEvent renders gin-contrib/sse events, Stream repeatedly invokes a callback and flushes, and Negotiate selects supported formats or aborts with 406.
- Built-in helpers cover Basic and proxy authentication, configurable request logging, panic recovery, and cookie creation with caller-selected security attributes.