Documentation ¶
Index ¶
- func GenerateToken(info model.UserInfo, secretKey []byte, duration time.Duration) (string, error)
- func HashPassword(password string) (string, error)
- func VerifyPassword(hashedPassword, candidatePassword string) bool
- func VerifyToken(tokenStr string, secretKey []byte) (*model.UserClaims, error)
- type AccessChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateToken ¶
func HashPassword ¶
func VerifyPassword ¶
func VerifyToken ¶
func VerifyToken(tokenStr string, secretKey []byte) (*model.UserClaims, error)
Types ¶
type AccessChecker ¶
type AccessChecker interface {
AccessCheck(ctx context.Context, token string, endpoint string) (bool, error)
}
func NewRouteAccessChecker ¶
func NewRouteAccessChecker(jwtCfg config.JWTConfig, redis storage.Redis, repo repository.UserRepository) AccessChecker
Click to show internal directories.
Click to hide internal directories.