gin

package module
v0.0.0-...-ca3b2fc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package gin adapts the framework-agnostic oapi core onto the gin web framework. Register oapi routes with Register / RegisterAll and serve the generated OpenAPI document with SpecHandler.

Index

Constants

This section is empty.

Variables

View Source
var DefaultMaxRequestBytes int64 = 10 << 20 // 10 MiB

DefaultMaxRequestBytes caps how many bytes the adapter reads from a request body (JSON, urlencoded and multipart), guarding against memory/disk exhaustion from oversized uploads. Set it to 0 to disable the cap (e.g. when you enforce limits with your own middleware). Override before registering routes.

Functions

func Register

func Register(router gin.IRoutes, route oapi.Route, native ...gin.HandlerFunc)

Register mounts a single oapi.Route on a gin router. Optional native gin middlewares run before the route handler; an aborting middleware skips it.

func RegisterAll

func RegisterAll(router gin.IRoutes, routes ...oapi.Route)

RegisterAll mounts every route on the router.

func SpecHandler

func SpecHandler(reg *oapi.Registry) gin.HandlerFunc

SpecHandler serves a registry's OpenAPI document as JSON. The document is built once on first request.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL