middleware

package
v8.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

func CasbinMiddleware

func CasbinMiddleware(enforcer *casbin.SyncedEnforcer, skippers ...SkipperFunc) gin.HandlerFunc

Valid use interface permission

func CopyBodyMiddleware

func CopyBodyMiddleware(skippers ...SkipperFunc) gin.HandlerFunc

Copy body to context bytes array

func EmptyMiddleware

func EmptyMiddleware() gin.HandlerFunc

func JoinRouter

func JoinRouter(method, path string) string

func LoggerMiddleware

func LoggerMiddleware(skippers ...SkipperFunc) gin.HandlerFunc

Request logger

func NoMethodHandler

func NoMethodHandler() gin.HandlerFunc

func NoRouteHandler

func NoRouteHandler() gin.HandlerFunc

func RateLimiterMiddleware

func RateLimiterMiddleware(skippers ...SkipperFunc) gin.HandlerFunc

Request rate limter (per minute)

func RecoveryMiddleware

func RecoveryMiddleware() gin.HandlerFunc

func SkipHandler

func SkipHandler(c *gin.Context, skippers ...SkipperFunc) bool

func TraceMiddleware

func TraceMiddleware(skippers ...SkipperFunc) gin.HandlerFunc

Get or set trace_id in request context

func UserAuthMiddleware

func UserAuthMiddleware(a auth.Auther, skippers ...SkipperFunc) gin.HandlerFunc

Valid user token (jwt)

func WWWMiddleware

func WWWMiddleware(root string, skippers ...SkipperFunc) gin.HandlerFunc

Types

type SkipperFunc

type SkipperFunc func(*gin.Context) bool

func AllowMethodAndPathPrefixSkipper

func AllowMethodAndPathPrefixSkipper(prefixes ...string) SkipperFunc

func AllowPathPrefixNoSkipper

func AllowPathPrefixNoSkipper(prefixes ...string) SkipperFunc

func AllowPathPrefixSkipper

func AllowPathPrefixSkipper(prefixes ...string) SkipperFunc

Jump to

Keyboard shortcuts

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