middleware

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: GPL-3.0 Imports: 23 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

CORSMiddleware - Cross-domain request middleware

func CasbinMiddleware

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

CasbinMiddleware - Casbin middleware

func EmptyMiddleware

func EmptyMiddleware() gin.HandlerFunc

EmptyMiddleware - Middleware that does not perform business processing

func JoinRouter

func JoinRouter(method, path string) string

JoinRouter - Splicing route

func LoggerMiddleware

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

LoggerMiddleware - Log middleware

func NoMethodHandler

func NoMethodHandler() gin.HandlerFunc

NoMethodHandler - The handler for the request method was not found

func NoRouteHandler

func NoRouteHandler() gin.HandlerFunc

NoRouteHandler - The handler for request routing was not found

func RateLimiterMiddleware

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

RateLimiterMiddleware - Request frequency limit middleware

func RecoveryMiddleware

func RecoveryMiddleware() gin.HandlerFunc

RecoveryMiddleware - Crash recovery middleware

func SkipHandler

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

SkipHandler - Unified processing of skip functions

func TraceMiddleware

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

TraceMiddleware - Tracking ID middleware

func UserAuthMiddleware

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

UserAuthMiddleware - User authorization middleware

func WWWMiddleware

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

WWWMiddleware - Static site middleware

Types

type SkipperFunc

type SkipperFunc func(*gin.Context) bool

SkipperFunc - Define middleware skip function

func AllowMethodAndPathPrefixSkipper

func AllowMethodAndPathPrefixSkipper(prefixes ...string) SkipperFunc

AllowMethodAndPathPrefixSkipper Check if the request method and path contain the specified prefix, skip if not included

func AllowPathPrefixNoSkipper

func AllowPathPrefixNoSkipper(prefixes ...string) SkipperFunc

AllowPathPrefixNoSkipper - Check if the request path contains the specified prefix, if not, skip it

func AllowPathPrefixSkipper

func AllowPathPrefixSkipper(prefixes ...string) SkipperFunc

AllowPathPrefixSkipper - Check if the request path contains the specified prefix, skip if it is included

Jump to

Keyboard shortcuts

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