Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrExpiredToken = errors.New("token has expired") ErrInvalidToken = errors.New("token is invalid") )
Different types of error returned by the VerifyToken Function
Functions ¶
This section is empty.
Types ¶
type JWTMaker ¶
type JWTMaker struct {
// contains filtered or unexported fields
}
JWTMaker is a JSON Web Token maker
func (JWTMaker) CreateToken ¶
CreateToken creates a new token for a specific username and duration
type Maker ¶
type Maker interface { // CreateToken creates a new token for a specific username and duration CreateToken(username string, duration time.Duration) (string, *Payload, error) // VerifyToken checks if the token is valid or not VerifyToken(token string) (*Payload, error) }
func NewJWTMaker ¶
func NewPasetoMaker ¶
NewPasetoMaker creates a new PasetoMaker
type PasetoMake ¶
type PasetoMake struct {
// contains filtered or unexported fields
}
PasetoMake is a PASETO token maker
func (PasetoMake) CreateToken ¶
func (PasetoMake) VerifyToken ¶
func (p PasetoMake) VerifyToken(token string) (*Payload, error)
Click to show internal directories.
Click to hide internal directories.