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
- type Phone
- 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 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 }
func NewOTP ¶
func NewOTP(gateways ...IOTPSMSGateway) *OTP
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.