Documentation
¶
Index ¶
- type Claims
- type JWTService
- func (j *JWTService) CheckPassword(hashedPassword, password string) bool
- func (j *JWTService) GenerateAccessToken(user *domain.User) (string, time.Time, error)
- func (j *JWTService) GenerateRefreshToken(user *domain.User) (string, time.Time, error)
- func (j *JWTService) HashPassword(password string) (string, error)
- func (j *JWTService) ValidateAccessToken(tokenString string) (*Claims, error)
- func (j *JWTService) ValidateRefreshToken(tokenString string) (*Claims, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct {
UserId int `json:"user_id"`
Username string `json:"username"`
jwt.RegisteredClaims
}
type JWTService ¶
type JWTService struct {
// contains filtered or unexported fields
}
func NewJWTService ¶
func NewJWTService(cfg *config.Config) *JWTService
func (*JWTService) CheckPassword ¶
func (j *JWTService) CheckPassword(hashedPassword, password string) bool
func (*JWTService) GenerateAccessToken ¶
func (*JWTService) GenerateRefreshToken ¶
func (*JWTService) HashPassword ¶
func (j *JWTService) HashPassword(password string) (string, error)
func (*JWTService) ValidateAccessToken ¶
func (j *JWTService) ValidateAccessToken(tokenString string) (*Claims, error)
func (*JWTService) ValidateRefreshToken ¶
func (j *JWTService) ValidateRefreshToken(tokenString string) (*Claims, error)
Click to show internal directories.
Click to hide internal directories.