Documentation ¶
Index ¶
- type AuthService
- func (s *AuthService) CreateUser(ctx context.Context, user *entities.User) (*entities.User, error)
- func (s *AuthService) GenerateTokens(ctx context.Context, userID uuid.UUID) (*AuthTokens, error)
- func (s *AuthService) GenerateTokensViaCredentials(ctx context.Context, username string, password string) (*AuthTokens, error)
- func (s *AuthService) GenerateTokensViaRefreshToken(ctx context.Context, token string) (*AuthTokens, error)
- func (s *AuthService) VerifyToken(ctx context.Context, accessToken string) (*entities.UserClaims, error)
- type AuthTokens
- type RefreshTokenWithSecret
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(user *repositories.UserRepository, refreshToken *repositories.RefreshTokenRepository, accessTokenSigningKey string) *AuthService
func (*AuthService) CreateUser ¶
func (*AuthService) GenerateTokens ¶ added in v0.1.8
func (s *AuthService) GenerateTokens(ctx context.Context, userID uuid.UUID) (*AuthTokens, error)
func (*AuthService) GenerateTokensViaCredentials ¶
func (s *AuthService) GenerateTokensViaCredentials(ctx context.Context, username string, password string) (*AuthTokens, error)
func (*AuthService) GenerateTokensViaRefreshToken ¶
func (s *AuthService) GenerateTokensViaRefreshToken(ctx context.Context, token string) (*AuthTokens, error)
func (*AuthService) VerifyToken ¶
func (s *AuthService) VerifyToken(ctx context.Context, accessToken string) (*entities.UserClaims, error)
type AuthTokens ¶
type RefreshTokenWithSecret ¶
type RefreshTokenWithSecret struct { Secret string *entities.RefreshToken }
Click to show internal directories.
Click to hide internal directories.