Documentation
¶
Index ¶
Constants ¶
View Source
const ( AccessTokenExpiration = time.Hour RefreshTokenExpiration = time.Hour * 24 * 7 )
Variables ¶
View Source
var ( ErrTokenInvalid = errors.New("token is invalid") ErrTokenExpired = errors.New("token is expired") )
Functions ¶
This section is empty.
Types ¶
type JWTMaker ¶
type JWTMaker struct {
// contains filtered or unexported fields
}
func (*JWTMaker) CreateRefreshToken ¶
func (*JWTMaker) CreateToken ¶
type Maker ¶
type Maker interface { CreateToken(username string) (string, *Payload, error) CreateRefreshToken(username string) (string, *Payload, error) VerifyToken(token string) (*Payload, error) }
func NewJWTMaker ¶
func NewPasetoMaker ¶
type PasetoMaker ¶
type PasetoMaker struct {
// contains filtered or unexported fields
}
func (*PasetoMaker) CreateRefreshToken ¶
func (pasetoMaker *PasetoMaker) CreateRefreshToken(username string) (string, *Payload, error)
func (*PasetoMaker) CreateToken ¶
func (pasetoMaker *PasetoMaker) CreateToken(username string) (string, *Payload, error)
func (*PasetoMaker) VerifyToken ¶
func (pasetoMaker *PasetoMaker) VerifyToken(token string) (*Payload, error)
Click to show internal directories.
Click to hide internal directories.