30 lines
455 B
Go
30 lines
455 B
Go
package user
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
const (
|
|
OtpExpiry = 5 * time.Minute
|
|
)
|
|
|
|
type Service struct {
|
|
userStore UserStore
|
|
otpStore OtpStore
|
|
smsGateway SmsGateway
|
|
emailGateway EmailGateway
|
|
}
|
|
|
|
func NewService(
|
|
userStore UserStore,
|
|
otpStore OtpStore, smsGateway SmsGateway,
|
|
emailGateway EmailGateway,
|
|
) *Service {
|
|
return &Service{
|
|
userStore: userStore,
|
|
otpStore: otpStore,
|
|
smsGateway: smsGateway,
|
|
emailGateway: emailGateway,
|
|
}
|
|
}
|