middleware

package
v0.0.0-...-c6f1323 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppInfo

func AppInfo() gin.HandlerFunc

func CheckCasbinAuth

func CheckCasbinAuth() gin.HandlerFunc

func ContextTimeout

func ContextTimeout(t time.Duration) func(c *gin.Context)

设置超时时间

func Cookie()

func Cors

func Cors() gin.HandlerFunc

Cors 跨域解决

func JWT

func JWT() gin.HandlerFunc

func JWTAuth

func JWTAuth() gin.HandlerFunc

定义一个JWTAuth的中间件

func MaxAllowed

func MaxAllowed(limitValue int64) func(c *gin.Context)

func MustLogin

func MustLogin() gin.HandlerFunc

必须登录判断 中间件

func Translations

func Translations() gin.HandlerFunc

Types

type GinPrometheus

type GinPrometheus struct {
	// contains filtered or unexported fields
}

GinPrometheus gin调用Prometheus的struct

func NewPrometheus

func NewPrometheus(e *gin.Engine, options ...Option) *GinPrometheus

New new gin prometheus

func (*GinPrometheus) Middleware

func (gp *GinPrometheus) Middleware() gin.HandlerFunc

Middleware set gin middleware

type Option

type Option func(*GinPrometheus)

func Ignore

func Ignore(path ...string) Option

Ignore 添加忽略的路径

Jump to

Keyboard shortcuts

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