Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct { TD entity.TokenDetails jwt.StandardClaims }
type JWTConfiguration ¶
type JWTConfiguration func(*JWTService) error
func WithRedisCacheRepository ¶
func WithRedisCacheRepository(config config.Redis) JWTConfiguration
type JWTService ¶
type JWTService struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfgs ...JWTConfiguration) (*JWTService, error)
func (*JWTService) CreateTokensAndMetaData ¶
func (j *JWTService) CreateTokensAndMetaData(username string) (*entity.TokenDetails, error)
Generate Both access token and refresh token and set them in redis as well
func (*JWTService) Middleware ¶
func (r *JWTService) Middleware() gin.HandlerFunc
func (*JWTService) VerifyToken ¶
func (j *JWTService) VerifyToken(tokenString, secret string) (*jwt.Token, error)
Verify JWT based on given secret which can be for accesstoken and refreshtoken
Click to show internal directories.
Click to hide internal directories.