Documentation
¶
Index ¶
- Variables
- func Bind(ctx *gin.Context, obj interface{}) error
- func DefaultBinding(ctx *gin.Context) binding.Binding
- func DefaultRender(ctx *gin.Context, obj interface{}) render.Render
- func MustBind(ctx *gin.Context, obj interface{}) error
- func Recovery(f func(c *gin.Context, err interface{})) gin.HandlerFunc
- func RecoveryWithWriter(out io.Writer, f func(c *gin.Context, err interface{})) gin.HandlerFunc
- func Redirect(code int, path string) gin.HandlerFunc
- func RedirectTrim(code int, prefix string) gin.HandlerFunc
- func RequestIDFromGinContext(ctx *gin.Context) string
- func ShouldBind(ctx *gin.Context, obj interface{}) error
- func UseHTTPPreflight() gin.HandlerFunc
- func UseNegroni(n *negroni.Negroni) gin.HandlerFunc
- func XRequestId(keys ...interface{}) gin.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var NopHandlerFunc = gin.HandlerFunc(func(c *gin.Context) { if c == nil { return } c.Next() })
Functions ¶
func DefaultBinding ¶
Default returns the appropriate Binding instance based on the HTTP method and the content type.
func DefaultRender ¶
DefaultRender returns the appropriate Binding instance based on the HTTP method and the content type.
func MustBind ¶
MustBindWith binds the passed struct pointer using the specified binding engine. It will abort the request with HTTP 400 if any error occurs. See the binding package.
func RecoveryWithWriter ¶
func RedirectTrim ¶
func RedirectTrim(code int, prefix string) gin.HandlerFunc
func RequestIDFromGinContext ¶
func ShouldBind ¶
ShouldBind binds the passed struct pointer using the specified binding engine. See the binding package.
func UseHTTPPreflight ¶
func UseHTTPPreflight() gin.HandlerFunc
func UseNegroni ¶
func UseNegroni(n *negroni.Negroni) gin.HandlerFunc
WrapGinF is a helper function for wrapping gin.HandlerFunc Returns a negroni middleware
func XRequestId ¶
func XRequestId(keys ...interface{}) gin.HandlerFunc
XRequestId returns a new server interceptors with x-request-id in context.
Types ¶
This section is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.