Documentation ¶
Index ¶
- func CORSMiddleware() gin.HandlerFunc
- func CasbinMiddleware(enforcer *casbin.SyncedEnforcer, skippers ...SkipperFunc) gin.HandlerFunc
- func EmptyMiddleware() gin.HandlerFunc
- func JoinRouter(method, path string) string
- func LoggerMiddleware(skippers ...SkipperFunc) gin.HandlerFunc
- func NoMethodHandler() gin.HandlerFunc
- func NoRouteHandler() gin.HandlerFunc
- func RateLimiterMiddleware(skippers ...SkipperFunc) gin.HandlerFunc
- func RecoveryMiddleware() gin.HandlerFunc
- func SkipHandler(c *gin.Context, skippers ...SkipperFunc) bool
- func TraceMiddleware(skippers ...SkipperFunc) gin.HandlerFunc
- func UserAuthMiddleware(a auth.Auther, skippers ...SkipperFunc) gin.HandlerFunc
- func WWWMiddleware(root string, skippers ...SkipperFunc) gin.HandlerFunc
- type SkipperFunc
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 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 ¶
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