Documentation ¶
Index ¶
- func CORSMiddleware() gin.HandlerFunc
- func CasbinMiddleware(enforcer *casbin.SyncedEnforcer, skippers ...SkipperFunc) gin.HandlerFunc
- func CopyBodyMiddleware(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
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 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 ¶
func AllowMethodAndPathPrefixSkipper ¶
func AllowMethodAndPathPrefixSkipper(prefixes ...string) SkipperFunc
func AllowPathPrefixNoSkipper ¶
func AllowPathPrefixNoSkipper(prefixes ...string) SkipperFunc
func AllowPathPrefixSkipper ¶
func AllowPathPrefixSkipper(prefixes ...string) SkipperFunc
Click to show internal directories.
Click to hide internal directories.