Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidToken = errors.New("token is invalid") ErrExpiredToken = errors.New("token has expired") )
Functions ¶
Types ¶
type JWTMaker ¶
type JWTMaker struct {
// contains filtered or unexported fields
}
func (*JWTMaker) CreateToken ¶
type Maker ¶
type Maker interface {
CreateToken(username string, role string, duration time.Duration) (string, error)
VerifyToken(token string) (*Payload, error)
}
func NewJWTMaker ¶
NewJWTMaker creates a JWTMaker with secret key length = 32
Click to show internal directories.
Click to hide internal directories.