Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyKey when key is empty. ErrEmptyKey = errors.New("empty sign key") // ErrTokenInvalid when token has expired or has invalid data. ErrTokenInvalid = errors.New("invalid token") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { SigningKey string SigningMethod libjwt.SigningMethod KeyFunc libjwt.Keyfunc }
Config defines the config for JWT tokens.
func NewJWTConfig ¶
NewJWTConfig creates an instance of a default jwt config.
func (Config) GenerateToken ¶
GenerateToken generates a JWT token for given config and claims.
func (Config) ValidateToken ¶
ValidateToken returns whether given token is valid or not for configuration.
Click to show internal directories.
Click to hide internal directories.