Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JwtWrapper ¶
type JwtWrapper struct { SecretKey string // key used for signing the JWT token Issuer string // Issuer of the JWT token ExpirationMinutes int64 // Number of minutes the JWT token will be valid for ExpirationHours int64 // Expiration time of the JWT token in hours }
func (*JwtWrapper) GenerateToken ¶
func (j *JwtWrapper) GenerateToken(id int) (signedToken string, err error)
GenerateToken generates a jwt token
func (*JwtWrapper) RefreshToken ¶
func (j *JwtWrapper) RefreshToken(id int) (signedtoken string, err error)
RefreshToken generates a refresh jwt token
func (*JwtWrapper) ValidateToken ¶
func (j *JwtWrapper) ValidateToken(signedToken string) (claims *jwt.StandardClaims, err error)
ValidateToken validates the jwt token
Click to show internal directories.
Click to hide internal directories.