Documentation
¶
Index ¶
- Variables
- func AddToBlacklist(r *http.Request) error
- func FailureAllClient(tokenId string) error
- func Init(opts *Options)
- func IsBlacklisted(token *jwt.Token) bool
- func ParseRequest(r *http.Request) (string, error)
- func ParseToken(r *http.Request) (*jwt.Token, error)
- func Sign(tokenId string) (*response.TokenResponse, error)
- type Blacklist
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMissingHeader 表示 `Authorization` 请求头为空. ErrMissingHeader = errors.New("the length of the `Authorization` header is zero") // ErrBlacklistToken 表示存在于黑名单中的 token ErrBlacklistToken = errors.New("token has in blacklist and expire") // ErrParseToken 表示解析 token 字符串失败 ErrParseToken = errors.New("parse token error") )
Functions ¶
func ParseRequest ¶
ParseRequest 从请求头中获取令牌,并将其传递给 ParseToken 函数以解析令牌.
func ParseToken ¶
ParseToken 解析令牌字符串为 jwt.Token 对象
Types ¶
Click to show internal directories.
Click to hide internal directories.