Documentation ¶
Index ¶
- type Services
- type TokenPair
- type TokensService
- func (s *TokensService) InvalidateRefreshToken(ctx context.Context, tokenID uuid.UUID) error
- func (s *TokensService) InvalidateUser(ctx context.Context, userID uuid.UUID) error
- func (s *TokensService) NewTokenPair(userID uuid.UUID) (TokenPair, error)
- func (s *TokensService) ParseAccessToken(token string) (domain.Token, error)
- func (s *TokensService) ParseRefreshToken(token string) (domain.Token, error)
- func (s *TokensService) SaveRefreshToken(ctx context.Context, token *domain.Token) error
- func (s *TokensService) SaveRefreshTokenFromString(ctx context.Context, token string) error
- func (s *TokensService) ValidateAccessToken(token string) (jwt5.MapClaims, error)
- func (s *TokensService) ValidateRefreshToken(token string) (jwt5.MapClaims, error)
- type UsersService
- func (s *UsersService) ComparePasswordAndHash(password, hashed string) bool
- func (s *UsersService) Delete(ctx context.Context, id uuid.UUID) error
- func (s *UsersService) Get(ctx context.Context, id uuid.UUID) (domain.User, error)
- func (s *UsersService) GetByCredentials(ctx context.Context, email, password string) (domain.User, error)
- func (s *UsersService) Save(ctx context.Context, user *domain.User) error
- func (s *UsersService) Update(ctx context.Context, user *domain.User) error
- func (s *UsersService) ValidateEmail(email string) error
- func (s *UsersService) ValidateName(name string) error
- func (s *UsersService) ValidatePassword(password string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Services ¶
type Services struct { Users *UsersService Tokens *TokensService }
type TokensService ¶
type TokensService struct { AccessTokenTTL time.Duration RefreshTokenTTL time.Duration // contains filtered or unexported fields }
func NewTokensService ¶
func NewTokensService(repo repository.TokensRepository, jwtTm jwt.TokenManager, accessTokenTTL, refreshTokenTTL time.Duration) *TokensService
func (*TokensService) InvalidateRefreshToken ¶
func (*TokensService) InvalidateUser ¶
func (*TokensService) NewTokenPair ¶
func (s *TokensService) NewTokenPair(userID uuid.UUID) (TokenPair, error)
func (*TokensService) ParseAccessToken ¶
func (s *TokensService) ParseAccessToken(token string) (domain.Token, error)
func (*TokensService) ParseRefreshToken ¶
func (s *TokensService) ParseRefreshToken(token string) (domain.Token, error)
func (*TokensService) SaveRefreshToken ¶
func (*TokensService) SaveRefreshTokenFromString ¶
func (s *TokensService) SaveRefreshTokenFromString(ctx context.Context, token string) error
func (*TokensService) ValidateAccessToken ¶
func (s *TokensService) ValidateAccessToken(token string) (jwt5.MapClaims, error)
func (*TokensService) ValidateRefreshToken ¶
func (s *TokensService) ValidateRefreshToken(token string) (jwt5.MapClaims, error)
type UsersService ¶
type UsersService struct {
// contains filtered or unexported fields
}
func NewUsersService ¶
func NewUsersService(repo repository.UsersRepository, hasher hash.Hasher, validator *validator.CredentialsValidator) *UsersService
func (*UsersService) ComparePasswordAndHash ¶
func (s *UsersService) ComparePasswordAndHash(password, hashed string) bool
func (*UsersService) GetByCredentials ¶
func (*UsersService) ValidateEmail ¶
func (s *UsersService) ValidateEmail(email string) error
func (*UsersService) ValidateName ¶
func (s *UsersService) ValidateName(name string) error
func (*UsersService) ValidatePassword ¶
func (s *UsersService) ValidatePassword(password string) error
Click to show internal directories.
Click to hide internal directories.