-
Notifications
You must be signed in to change notification settings - Fork 13
/
otp.go
83 lines (66 loc) · 1.95 KB
/
otp.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package mocks
import (
beeorm "github.com/latolukasz/beeorm"
mock "github.com/stretchr/testify/mock"
otp "github.com/coretrix/hitrix/service/component/otp"
)
type OTPService struct {
mock.Mock
}
func (o *OTPService) Call(ormService *beeorm.Engine, phone *otp.Phone, customMessage string) (string, error) {
ret := o.Called(ormService, phone, customMessage)
var r0 string
if rf, ok := ret.Get(0).(func(*beeorm.Engine, *otp.Phone, string) string); ok {
r0 = rf(ormService, phone, customMessage)
} else {
r0 = ret.Get(0).(string)
}
var r1 error
if rf, ok := ret.Get(1).(func(*beeorm.Engine, *otp.Phone, string) error); ok {
r1 = rf(ormService, phone, customMessage)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
func (o *OTPService) SendSMS(ormService *beeorm.Engine, phone *otp.Phone) (string, error) {
ret := o.Called(ormService, phone)
var r0 string
if rf, ok := ret.Get(0).(func(*beeorm.Engine, *otp.Phone) string); ok {
r0 = rf(ormService, phone)
} else {
r0 = ret.Get(0).(string)
}
var r1 error
if rf, ok := ret.Get(1).(func(*beeorm.Engine, *otp.Phone) error); ok {
r1 = rf(ormService, phone)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
func (o *OTPService) VerifyOTP(ormService *beeorm.Engine, phone *otp.Phone, code string) (bool, bool, error) {
ret := o.Called(ormService, phone, code)
var r0 bool
if rf, ok := ret.Get(0).(func(*beeorm.Engine, *otp.Phone, string) bool); ok {
r0 = rf(ormService, phone, code)
} else {
r0 = ret.Get(0).(bool)
}
var r1 bool
if rf, ok := ret.Get(1).(func(*beeorm.Engine, *otp.Phone, string) bool); ok {
r1 = rf(ormService, phone, code)
} else {
r1 = ret.Get(1).(bool)
}
var r2 error
if rf, ok := ret.Get(2).(func(*beeorm.Engine, *otp.Phone, string) error); ok {
r2 = rf(ormService, phone, code)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
func (o *OTPService) GetGatewayRegistry() map[string]otp.IOTPSMSGateway {
return o.Called().Get(0).(map[string]otp.IOTPSMSGateway)
}