gin_middlewares

package
v0.0.0-...-9fc37f3 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IndexGinFuncs []string
View Source
var UseFuncs = make(map[string]gin.HandlerFunc)

Functions

func LoadCors

func LoadCors(conf config.Config) gin.HandlerFunc

func LoadGZip

func LoadGZip(conf config.Config) gin.HandlerFunc

func LoadPprof

func LoadPprof(engine *gin.Engine, conf config.Config)

func NewCSRF

func NewCSRF(c CSRFConfig) gin.HandlerFunc

func NewRequestID

func NewRequestID() gin.HandlerFunc

func RegisterUseFunc

func RegisterUseFunc(name string, fn gin.HandlerFunc) error

RegisterUseFunc 注册

func StatFunc

func StatFunc(logger logger.Logger) gin.HandlerFunc

StatFunc log request & response TODO added prometheus metrics

Types

type CSRFConfig

type CSRFConfig struct {
	QueryAllowHosts   func() []string
	QueryAllowPattern func() []string
	Validator         func(c *gin.Context) bool
}

type Handler

type Handler struct {
	Name    string
	URLPath string
	Method  string
	Func    gin.HandlerFunc
}

Jump to

Keyboard shortcuts

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