Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdminAuthorizator ¶
type AdminAuthorizator struct { }
AdminAuthorizator 管理员授权规则
func (*AdminAuthorizator) HandleAuthorizator ¶
func (*AdminAuthorizator) HandleAuthorizator(data interface{}, c *gin.Context) bool
HandleAuthorizator 处理管理员授权规则
type AllUserAuthorizator ¶
type AllUserAuthorizator struct { }
AllUserAuthorizator 普通用户授权规则
func (*AllUserAuthorizator) HandleAuthorizator ¶
func (*AllUserAuthorizator) HandleAuthorizator(data interface{}, c *gin.Context) bool
HandleAuthorizator 处理普通用户授权规则
type IAuthorizator ¶
IAuthorizator 授权规则接口
type JWT ¶
type JWT struct { UserService service.IUserService `inject:""` RoleService service.IRoleService `inject:""` }
JWT 注入IService
func (*JWT) GinJWTMiddlewareInit ¶
func (j *JWT) GinJWTMiddlewareInit(jwtAuthorizator IAuthorizator) (authMiddleware *jwt.GinJWTMiddleware)
GinJWTMiddlewareInit 初始化中间件
type TestAuthorizator ¶
type TestAuthorizator struct { }
TestAuthorizator 测试用户授权规则
func (*TestAuthorizator) HandleAuthorizator ¶
func (*TestAuthorizator) HandleAuthorizator(data interface{}, c *gin.Context) bool
HandleAuthorizator 处理测试用户授权规则
Click to show internal directories.
Click to hide internal directories.