Documentation ¶
Index ¶
- Variables
- func AesEncDec() gin.HandlerFunc
- func CORSMiddleware() gin.HandlerFunc
- func CookieData()
- func Cors() gin.HandlerFunc
- func Cors2() gin.HandlerFunc
- func ErrorLogHandler() gin.HandlerFunc
- func JoinRouter(method, path string) string
- func NewCookie()
- func NewSession(c *gin.Context, userData map[string]interface{}) error
- func NoCache(c *gin.Context)
- func NoMethodHandler() gin.HandlerFunc
- func NoRouteHandler() gin.HandlerFunc
- func Options(c *gin.Context)
- func PermissionMiddleware(skipper ...SkipperFunc) gin.HandlerFunc
- func RecoveryMiddleware() gin.HandlerFunc
- func Secure(c *gin.Context)
- func SessionData(c *gin.Context) (map[string]interface{}, error)
- func TokenData(c *gin.Context) (map[string]interface{}, error)
- func UserAuthMiddleware(skipper ...SkipperFunc) gin.HandlerFunc
- type SkipperFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( JwtType string = "Bearer" JwtKey string = "xxx" HeaderTag string = "Authorization" )
Functions ¶
func AesEncDec ¶ added in v1.10.2
func AesEncDec() gin.HandlerFunc
func CORSMiddleware ¶
func CORSMiddleware() gin.HandlerFunc
func CookieData ¶
func CookieData()
func Cors ¶
func Cors() gin.HandlerFunc
func Cors2 ¶
func Cors2() gin.HandlerFunc
func ErrorLogHandler ¶
func ErrorLogHandler() gin.HandlerFunc
func NoCache ¶
NoCache is a middleware function that appends headers to prevent the client from caching the HTTP response.
func Options ¶
Options is a middleware function that appends headers for options requests and aborts then exits the middleware chain and ends the request.
func PermissionMiddleware ¶
func PermissionMiddleware(skipper ...SkipperFunc) gin.HandlerFunc
PermissionMiddleware 权限中间件
func UserAuthMiddleware ¶
func UserAuthMiddleware(skipper ...SkipperFunc) gin.HandlerFunc
UserAuthMiddleware 用户授权中间件
Types ¶
type SkipperFunc ¶
SkipperFunc 定义中间件跳过函数
func AllowMethodAndPathPrefixSkipper ¶
func AllowMethodAndPathPrefixSkipper(prefixes ...string) SkipperFunc
AllowMethodAndPathPrefixSkipper 检查请求方法和路径是否包含指定的前缀,如果包含则跳过
func AllowPathPrefixNoSkipper ¶
func AllowPathPrefixNoSkipper(prefixes ...string) SkipperFunc
AllowPathPrefixNoSkipper 检查请求路径是否包含指定的前缀,如果包含则不跳过
func AllowPathPrefixSkipper ¶
func AllowPathPrefixSkipper(prefixes ...string) SkipperFunc
AllowPathPrefixSkipper 检查请求路径是否包含指定的前缀,如果包含则跳过
Click to show internal directories.
Click to hide internal directories.