Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTokenMiss = errors.New(500, "token miss", "token miss") ErrClaimsMiss = errors.New(500, "claims miss", "claims miss") )
Functions ¶
func NewSecurityUser ¶
func NewSecurityUser() authz.SecurityUser
Types ¶
type TokenClaims ¶
type TokenClaims struct { UserID int64 `json:"user_id"` RoleID int64 `json:"role_id"` RoleKey string `json:"role_key"` Nickname string `json:"nickname"` gojwt.RegisteredClaims }
func FromContext ¶
func FromContext(ctx context.Context) (*TokenClaims, error)
func MustFromContext ¶
func MustFromContext(ctx context.Context) *TokenClaims
Click to show internal directories.
Click to hide internal directories.