Documentation ¶
Index ¶
- Constants
- type IOTP
- type IOTPSMSGateway
- type Mada
- func (m *Mada) Call(_ *Phone, _ string, _ string) (string, string, error)
- func (m *Mada) GetCode() string
- func (m *Mada) GetName() string
- func (m *Mada) GetPhonePrefixes() []string
- func (m *Mada) SendOTP(phone *Phone, code string) (string, string, error)
- func (m *Mada) VerifyOTP(_ *Phone, code, generatedCode string) (string, string, bool, bool, error)
- type OTP
- func (o *OTP) Call(ormService *datalayer.ORM, phone *Phone, customMessage string) (string, error)
- func (o *OTP) GetGatewayRegistry() map[string]IOTPSMSGateway
- func (o *OTP) SendSMS(ormService *datalayer.ORM, phone *Phone) (string, error)
- func (o *OTP) VerifyOTP(ormService *datalayer.ORM, phone *Phone, code string) (bool, bool, error)
- type Phone
- type RetryDTO
- type Sinch
- func (s *Sinch) Call(_ *Phone, _ string, _ string) (string, string, error)
- func (s *Sinch) GetCode() string
- func (s *Sinch) GetName() string
- func (s *Sinch) GetPhonePrefixes() []string
- func (s *Sinch) SendOTP(phone *Phone, _ string) (string, string, error)
- func (s *Sinch) VerifyOTP(phone *Phone, code, _ string) (string, string, bool, bool, error)
- type Twilio
- func (t *Twilio) Call(phone *Phone, _ string, customMessage string) (string, string, error)
- func (t *Twilio) GetCode() string
- func (t *Twilio) GetName() string
- func (t *Twilio) GetPhonePrefixes() []string
- func (t *Twilio) SendOTP(phone *Phone, _ string) (string, string, error)
- func (t *Twilio) VerifyOTP(phone *Phone, code, _ string) (string, string, bool, bool, error)
Constants ¶
View Source
const SMSOTPProviderMada = "Mada"
View Source
const SMSOTPProviderSinch = "Sinch"
View Source
const SMSOTPProviderTwilio = "Twilio"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IOTP ¶
type IOTP interface { SendSMS(ormService *datalayer.ORM, phone *Phone) (string, error) VerifyOTP(ormService *datalayer.ORM, phone *Phone, code string) (bool, bool, error) Call(ormService *datalayer.ORM, phone *Phone, customMessage string) (string, error) GetGatewayRegistry() map[string]IOTPSMSGateway }
type IOTPSMSGateway ¶
type IOTPSMSGateway interface { GetName() string GetCode() string GetPhonePrefixes() []string SendOTP(phone *Phone, code string) (string, string, error) Call(phone *Phone, code string, customMessage string) (string, string, error) VerifyOTP(phone *Phone, code, generatedCode string) (string, string, bool, bool, error) }
type Mada ¶ added in v1.0.0
type Mada struct {
// contains filtered or unexported fields
}
func NewMadaSMSOTPProvider ¶ added in v1.0.0
func (*Mada) GetPhonePrefixes ¶ added in v1.0.0
type OTP ¶
type OTP struct { GatewayPriority []IOTPSMSGateway GatewayName map[string]IOTPSMSGateway GatewayPhonePrefixRegex map[*regexp.Regexp]IOTPSMSGateway RetryOTP bool }
func NewOTP ¶
func NewOTP(retryOTP bool, gateways ...IOTPSMSGateway) *OTP
func (*OTP) GetGatewayRegistry ¶ added in v1.1.40
func (o *OTP) GetGatewayRegistry() map[string]IOTPSMSGateway
type Phone ¶
type Phone struct { Number string ISO3166 phonenumber.ISO3166 }
type Sinch ¶ added in v0.9.91
func NewSinchSMSOTPProvider ¶ added in v0.9.91
func (*Sinch) GetPhonePrefixes ¶ added in v1.0.0
type Twilio ¶
type Twilio struct { Client *twilio.RestClient VerificationSID string }
func NewTwilioSMSOTPProvider ¶
func (*Twilio) GetPhonePrefixes ¶ added in v1.0.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.