Documentation ¶
Index ¶
- type ImplOTP
- func (f *ImplOTP) EmailVerificationOtp(ctx context.Context, email *string) (string, error)
- func (f *ImplOTP) GenerateAndSendOTP(ctx context.Context, msisdn string, appID *string) (string, error)
- func (f *ImplOTP) GenerateOTP(ctx context.Context) (string, error)
- func (f *ImplOTP) GenerateRetryOTP(ctx context.Context, msisdn *string, retryStep int, appID *string) (string, error)
- func (f *ImplOTP) SaveOTPToFirestore(otp dto.OTP) error
- func (f *ImplOTP) SendOTPToEmail(ctx context.Context, msisdn string, email *string, appID *string) (string, error)
- func (f *ImplOTP) SendTemporaryPIN(ctx context.Context, input dto.TemporaryPIN) error
- func (f *ImplOTP) VerifyEmailOtp(ctx context.Context, email, verificationCode *string) (bool, error)
- func (f *ImplOTP) VerifyOtp(ctx context.Context, msisdn string, verificationCode *string) (bool, error)
- type UsecaseOTP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImplOTP ¶
type ImplOTP struct {
// contains filtered or unexported fields
}
ImplOTP is the OTP service implementation
func NewOTP ¶
func NewOTP(infrastructure infrastructure.Interactor) *ImplOTP
NewOTP initializes a otp service instance
func (*ImplOTP) EmailVerificationOtp ¶
EmailVerificationOtp generates an OTP to the supplied email for verification
func (*ImplOTP) GenerateAndSendOTP ¶
func (f *ImplOTP) GenerateAndSendOTP( ctx context.Context, msisdn string, appID *string, ) (string, error)
GenerateAndSendOTP creates an OTP and sends it to the supplied phone number as a text message
func (*ImplOTP) GenerateOTP ¶
GenerateOTP generates an OTP
func (*ImplOTP) GenerateRetryOTP ¶
func (f *ImplOTP) GenerateRetryOTP( ctx context.Context, msisdn *string, retryStep int, appID *string, ) (string, error)
GenerateRetryOTP generates fallback OTPs when Africa is talking sms fails
func (*ImplOTP) SaveOTPToFirestore ¶
SaveOTPToFirestore persists the supplied OTP
func (*ImplOTP) SendOTPToEmail ¶
func (f *ImplOTP) SendOTPToEmail( ctx context.Context, msisdn string, email *string, appID *string) (string, error)
SendOTPToEmail is a companion to GenerateAndSendOTP function It will send the generated OTP to the provided email address
func (*ImplOTP) SendTemporaryPIN ¶
SendTemporaryPIN sends a temporary PIN message to user via whatsapp and SMS
type UsecaseOTP ¶
type UsecaseOTP interface { GenerateAndSendOTP( ctx context.Context, msisdn string, appID *string, ) (string, error) SendOTPToEmail( ctx context.Context, msisdn, email *string, appID *string, ) (string, error) SaveOTPToFirestore( otp dto.OTP, ) error VerifyOtp( ctx context.Context, msisdn *string, verificationCode *string, ) (bool, error) VerifyEmailOtp( ctx context.Context, email *string, verificationCode *string, ) (bool, error) GenerateRetryOTP( ctx context.Context, msisdn *string, retryStep int, appID *string, ) (string, error) EmailVerificationOtp( ctx context.Context, email *string, ) (string, error) GenerateOTP( ctx context.Context, ) (string, error) SendTemporaryPIN( ctx context.Context, input dto.TemporaryPIN, ) error }
UsecaseOTP defines otp service usecases interface