Documentation ¶
Index ¶
Constants ¶
View Source
const FieldID userID = "uid"
FieldID field name for user ID
Variables ¶
This section is empty.
Functions ¶
func GenerateUserID ¶
func GenerateUserID() string
GenerateUserID - generates unique user id using uuid
Types ¶
type AuthRepository ¶
type AuthRepository struct {
// contains filtered or unexported fields
}
AuthRepository - Auth repository
func NewAuthRepository ¶
func NewAuthRepository( db *sqlx.DB, l contract.IApplicationLogger, ) *AuthRepository
NewAuthRepository - create new auth repository
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
AuthService - Auth service
func NewAuthService ¶
func NewAuthService( tokenProvider contract.ITokenProvider, repo contract.IAuthRepository, passHasher contract.IPassHasher, ) *AuthService
NewAuthService - create new auth service
type JwtTokenProvider ¶
type JwtTokenProvider struct {
// contains filtered or unexported fields
}
JwtTokenProvider - JWT Token Provider
func NewJwtTokenProvider ¶
func NewJwtTokenProvider(tokenKey []byte, f func() time.Time) *JwtTokenProvider
NewJwtTokenProvider - Create new JWT Token Provider
func (*JwtTokenProvider) GenerateToken ¶
GenerateToken - Generate new token
func (*JwtTokenProvider) ValidateToken ¶
func (j *JwtTokenProvider) ValidateToken( ctx context.Context, tokenString string, ) (string, error)
ValidateToken - Validate token
type PasswordService ¶
type PasswordService struct{}
PasswordService - Password service
func (*PasswordService) ComparePassword ¶
func (*PasswordService) ComparePassword( hashedPwd string, plainPwd []byte, ) (bool, error)
ComparePassword - Compare hashed password with plain password
func (*PasswordService) HashPassword ¶
func (*PasswordService) HashPassword(pwd []byte) (string, error)
HashPassword - Hash and salt password
Source Files ¶
Click to show internal directories.
Click to hide internal directories.