Documentation
¶
Index ¶
Constants ¶
View Source
const ( CleanUpExpiredVerificationRequestsTask = "clean_up_expired_verification_requests" CleanUpExpiredTokensTask = "clean_up_expired_tokens" )
Variables ¶
View Source
var ( ErrEmailTaken = errors.New("Email is already taken") ErrInvalidCredentials = errors.New("Invalid credentials. Please check your email and password and try again.") ErrUserNotFound = errors.New("User not found") ErrInvalidVerificationRequest = errors.New("Invalid verification request") ErrInvalidVerificationCode = errors.New("Invalid verification code") ErrVerificationCodeExpired = errors.New("Verification code expired") ErrUserNotVerified = errors.New("User not verified") ErrUserAlreadyVerified = errors.New("User already verified") )
Predefined errors
Functions ¶
Types ¶
type Service ¶
type Service interface { // Login authenticates a user and returns a user ID. Login(ctx context.Context, email, password string) (uuid.UUID, error) // Register creates a new user and returns a user ID. Register(ctx context.Context, email, password string) (uuid.UUID, error) // PasswordRecovery sends a password recovery email. PasswordRecovery(ctx context.Context, email string) error // PasswordReset resets a user password. PasswordReset(ctx context.Context, email, otp, password string) error // Verify user email with otp code VerifyEmail(ctx context.Context, email, code string) error // Resend verification email ResendVerificationEmail(ctx context.Context, email string) error // DestroyProfileRequest sends a destroy profile email. DestroyProfileRequest(ctx context.Context, email string) error // DestroyProfile destroys a user profile. DestroyProfile(ctx context.Context, email, otp string) error }
func NewService ¶
NewService creates a new auth service.
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker is a task handler for email delivery.
func NewWorker ¶
func NewWorker(repo workerRepository) *Worker
NewWorker creates a new email task handler.
func (*Worker) CleanUpExpiredTokens ¶
CleanUpExpiredTokens cleans up expired tokens.
func (*Worker) CleanUpExpiredVerificationRequests ¶
CleanUpExpiredVerificationRequests cleans up expired verification requests.
Click to show internal directories.
Click to hide internal directories.