service

package
v0.0.0-...-aaedd79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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 (j *JWTService) GenerateAccessToken(user *domain.User) (string, time.Time, error)

func (*JWTService) GenerateRefreshToken

func (j *JWTService) GenerateRefreshToken(user *domain.User) (string, time.Time, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL