Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingHeader = errors.New("the length of the `Authorization` header is zero")
ErrMissingHeader represent the error when the `Authorization` header is empty
Functions ¶
func Init ¶
Init sets the package-level config, which will used for token issuing and parsing in this package
func Parse ¶
Parse uses the specified key to parse the token. If successful, it returns the token context; otherwise, it returns an error tokenString is the token to be parsed key is the secret key used to sign the token
func ParseRequest ¶
ParseRequest is used to parse the token from the Authorization header and passes it to the Parse function for Token parsing
Types ¶
Click to show internal directories.
Click to hide internal directories.