Documentation
¶
Index ¶
- func CasbinSubject(c *gin.Context) string
- func FromDataScope(ctx context.Context) string
- func FromDeptId(ctx context.Context) int
- func FromPostId(ctx context.Context) int
- func FromRoleId(ctx context.Context) int
- func FromRoleKey(ctx context.Context) string
- func FromRoleName(ctx context.Context) string
- func FromUserId(ctx context.Context) int
- func FromUserIdStr(ctx context.Context) string
- func FromUserName(ctx context.Context) string
- type Config
- type Identities
- type IdentityKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CasbinSubject ¶
CasbinSubject get casbin subject from context, which is roleKey.
func FromDataScope ¶
FromDataScope get dataScope from context
func FromRoleKey ¶
FromRoleKey get roleKey from context
func FromRoleName ¶
FromRoleName get roleName from context
func FromUserIdStr ¶
FromUserIdStr get userId string from context
func FromUserName ¶
FromUserName get username from context
Types ¶
type Config ¶
type Config struct { Realm string `yaml:"realm" json:"realm"` SecretKey string `yaml:"secretKey" json:"secretKey"` Timeout time.Duration `yaml:"timeout" json:"timeout"` MaxRefresh time.Duration `yaml:"maxRefresh" json:"maxRefresh"` }
Config jwt 配置信息
type Identities ¶
type Identities struct { UserId int Username string DeptId int PostId int RoleId int RoleName string RoleKey string DataScope string }
Identities jwt identity
func FromIdentity ¶
func FromIdentity(ctx context.Context) Identities
FromIdentity get identity from context
Click to show internal directories.
Click to hide internal directories.