xhttp

package
v0.0.0-...-fa4b8cf Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Provide(New)

Functions

func Cors

func Cors() gin.HandlerFunc

Cors for options requests and aborts then exits the middleware chain and ends the request 解决跨域的是先发一次options请求,获取AllowHeader,允许跨域之后才会再发真正的Post请求

func New

func New(lifecycle fx.Lifecycle, vp *viper.Viper) *gin.Engine

func NoCache

func NoCache() gin.HandlerFunc

NoCache prevent the client from caching the HTTP response

func RequestID

func RequestID() gin.HandlerFunc

RequestID is a middleware function that appends RequestID.

func Secure

func Secure() gin.HandlerFunc

Secure is a middleware function that appends security and resource access headers.

func Translations

func Translations() gin.HandlerFunc

Types

type ValidError

type ValidError struct {
	Key     string `json:"key"`
	Message string `json:"message"`
}

func (*ValidError) Error

func (v *ValidError) Error() string

type ValidErrors

type ValidErrors []*ValidError

func ShouldBind

func ShouldBind(c *gin.Context, v interface{}) (bool, ValidErrors)

func ShouldBindJSON

func ShouldBindJSON(c *gin.Context, v interface{}) (bool, ValidErrors)

func ShouldBindQuery

func ShouldBindQuery(c *gin.Context, v interface{}) (bool, ValidErrors)

func ShouldBindUri

func ShouldBindUri(c *gin.Context, v interface{}) (bool, ValidErrors)

func (ValidErrors) Error

func (v ValidErrors) Error() string

func (ValidErrors) Errors

func (v ValidErrors) Errors() []string

Jump to

Keyboard shortcuts

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