Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSendSMS = errors.New("failed to send SMS") ErrSendEmail = errors.New("failed to send e-mail") )
View Source
var ServicesSet = wire.NewSet( NewJWTAuthenticator, NewNotificationService, )
Functions ¶
This section is empty.
Types ¶
type JWTAuthenticator ¶
type JWTAuthenticator struct {
// contains filtered or unexported fields
}
func NewJWTAuthenticator ¶
func NewJWTAuthenticator(jwtConfig *configs.JWTConfig) *JWTAuthenticator
func (*JWTAuthenticator) GenerateToken ¶
func (j *JWTAuthenticator) GenerateToken( userId string, duration time.Duration, ) (*models.TokenDetails, error)
func (*JWTAuthenticator) ParseToken ¶
func (j *JWTAuthenticator) ParseToken(token string) (*models.TokenDetails, error)
func (*JWTAuthenticator) SetJWTCookies ¶
func (j *JWTAuthenticator) SetJWTCookies(resp *core_dtos.ResponseDto, tokens *models.TokenPairs)
type NotificationService ¶
type NotificationService struct {
// contains filtered or unexported fields
}
func NewNotificationService ¶
func NewNotificationService( config *configs.OTPConfig, notifier *adapters.NotifierAdapter, ) *NotificationService
func (*NotificationService) GenerateAndSendEmailConfirm ¶
func (ns *NotificationService) GenerateAndSendEmailConfirm(email string) (string, error)
func (*NotificationService) GenerateAndSendOTPSms ¶
func (ns *NotificationService) GenerateAndSendOTPSms(phone string) (string, error)
func (*NotificationService) GenerateAndSendPhoneConfirm ¶
func (ns *NotificationService) GenerateAndSendPhoneConfirm(phone string) (string, error)
Click to show internal directories.
Click to hide internal directories.