Documentation ¶
Index ¶
- type AccessTokenCache
- type AccessTokenClaims
- type RefreshTokenClaims
- type Service
- func (r *Service) CreateCacheKey(userID int, td *TokenDetails) error
- func (r *Service) CreateToken(userid int) (*TokenDetails, error)
- func (r *Service) DecodeAccessToken(tokenString string) (*AccessTokenClaims, error)
- func (r *Service) DecodeRefreshToken(tokenString string) (*RefreshTokenClaims, error)
- func (r *Service) DropCacheKey(UUID string) error
- func (r *Service) DropCacheTokens(accessTokenClaims AccessTokenClaims) error
- func (r *Service) GetCacheValue(UUID string) (*string, error)
- type TokenDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessTokenCache ¶
type AccessTokenClaims ¶
type AccessTokenClaims struct { AccessUUID string `json:"accessUuid"` UserID int `json:"userId"` Exp int `json:"exp"` jwt.StandardClaims }
type RefreshTokenClaims ¶
type RefreshTokenClaims struct { RefreshUUID string `json:"refreshUuid"` UserID int `json:"userId"` Exp int `json:"exp"` jwt.StandardClaims }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(cache *redis.Client) *Service
func (*Service) CreateCacheKey ¶
func (r *Service) CreateCacheKey(userID int, td *TokenDetails) error
CreateCacheKey function that will be used to save the JWTs metadata in Redis
func (*Service) CreateToken ¶
func (r *Service) CreateToken(userid int) (*TokenDetails, error)
CreateToken returns JWT Token
func (*Service) DecodeAccessToken ¶
func (r *Service) DecodeAccessToken(tokenString string) (*AccessTokenClaims, error)
func (*Service) DecodeRefreshToken ¶
func (r *Service) DecodeRefreshToken(tokenString string) (*RefreshTokenClaims, error)
func (*Service) DropCacheKey ¶
DropCacheKey function that will be used to drop the JWTs metadata from Redis
func (*Service) DropCacheTokens ¶
func (r *Service) DropCacheTokens(accessTokenClaims AccessTokenClaims) error
Click to show internal directories.
Click to hide internal directories.