gin

package
v0.0.52 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: MIT Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NopHandlerFunc = gin.HandlerFunc(func(c *gin.Context) {
	if c == nil {
		return
	}
	c.Next()
})

Functions

func Bind

func Bind(ctx *gin.Context, obj interface{}) error

func DefaultBinding

func DefaultBinding(ctx *gin.Context) binding.Binding

Default returns the appropriate Binding instance based on the HTTP method and the content type.

func DefaultRender

func DefaultRender(ctx *gin.Context, obj interface{}) render.Render

DefaultRender returns the appropriate Binding instance based on the HTTP method and the content type.

func MustBind

func MustBind(ctx *gin.Context, obj interface{}) error

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 Recovery

func Recovery(f func(c *gin.Context, err interface{})) gin.HandlerFunc

func RecoveryWithWriter

func RecoveryWithWriter(out io.Writer, f func(c *gin.Context, err interface{})) gin.HandlerFunc

func Redirect

func Redirect(code int, path string) gin.HandlerFunc

func RedirectTrim

func RedirectTrim(code int, prefix string) gin.HandlerFunc

func RequestIDFromGinContext

func RequestIDFromGinContext(ctx *gin.Context) string

func ShouldBind

func ShouldBind(ctx *gin.Context, obj interface{}) error

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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