Documentation ¶
Index ¶
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(emailSender EmailSender, store CodeStore) *AuthService
func (*AuthService) SendAuthCode ¶
func (as *AuthService) SendAuthCode(ctx context.Context, email string) error
func (*AuthService) VerifyCode ¶
type EmailSender ¶
type InMemoryCodeStore ¶
type InMemoryCodeStore struct {
// contains filtered or unexported fields
}
func NewInMemoryCodeStore ¶
func NewInMemoryCodeStore() *InMemoryCodeStore
NewInMemoryCodeStore initializes and returns a new InMemoryCodeStore.
func (*InMemoryCodeStore) Delete ¶
func (s *InMemoryCodeStore) Delete(ctx context.Context, email string) error
Delete removes the authentication code for a given email from memory.
type RedisClient ¶
type RedisCodeStore ¶
type RedisCodeStore struct {
// contains filtered or unexported fields
}
func NewRedisCodeStore ¶
func NewRedisCodeStore(client RedisClient) *RedisCodeStore
func (*RedisCodeStore) Delete ¶
func (r *RedisCodeStore) Delete(ctx context.Context, email string) error
type SMTPEmailSender ¶
type SMTPEmailSender struct {
// contains filtered or unexported fields
}
func NewSMTPEmailSender ¶
func NewSMTPEmailSender(smtpHost, smtpPort, smtpUsername, smtpPassword, senderEmail string, allowUnencrypted bool) *SMTPEmailSender
func (*SMTPEmailSender) SendEmail ¶
func (s *SMTPEmailSender) SendEmail(to, subject, body string) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.