Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorExpiredToken = errors.New("token has expired") ErrorInvalidToken = errors.New("invalid token") )
Functions ¶
This section is empty.
Types ¶
type JWTTokenMaker ¶
type JWTTokenMaker struct {
// contains filtered or unexported fields
}
func (*JWTTokenMaker) CreateToken ¶
func (*JWTTokenMaker) VerifyToken ¶
func (tokenMaker *JWTTokenMaker) VerifyToken(token string) (*Payload, error)
type PasetoTokenMaker ¶
type PasetoTokenMaker struct {
// contains filtered or unexported fields
}
func (*PasetoTokenMaker) CreateToken ¶
func (*PasetoTokenMaker) VerifyToken ¶
func (tokenMaker *PasetoTokenMaker) VerifyToken(token string) (*Payload, error)
type Payload ¶
type TokenMaker ¶
type TokenMaker interface { CreateToken(userId string, duration time.Duration) (string, *Payload, error) VerifyToken(token string) (*Payload, error) }
func NewJWTTokenMaker ¶
func NewJWTTokenMaker(secretKey string) (TokenMaker, error)
func NewPasetoTokenMaker ¶
func NewPasetoTokenMaker(symmetricKey string) (TokenMaker, error)
Click to show internal directories.
Click to hide internal directories.