Versions in this module Expand all Collapse all v0 v0.0.2 Sep 7, 2023 Changes in this version + var ErrExpiredToken = errors.New("Token has expired") + var ErrInvalidJWTKeySize = errors.New(...) + var ErrInvalidPasetoKeySize = errors.New(...) + var ErrInvalidToken = errors.New("Token is invalid") + var ErrInvalidTokenType = errors.New("Invalid token type") + var ErrMissingCustomDuration = errors.New("Duration must be provided for CustomToken") + var ErrTooManyCustomDuration = errors.New("Provide too many durations") + func NewJWTMaker(id string) *jwtMaker + func NewPasetoMaker(id string) *pasetoMaker + type Payload struct + ExpiredAt time.Time + ID uuid.UUID + IssuedAt time.Time + UID string + func NewPayload(uid string, duration time.Duration) (*Payload, error) + func (payload *Payload) Valid() error + type TokenMaker interface + CreateToken func(tokenType TokenType, uid string, duration ...time.Duration) (string, *Payload, error) + VerifyToken func(token string) (*Payload, error) + type TokenType int + const AccessToken + const CustomToken + const RefreshToken