Documentation ¶
Index ¶
- Constants
- func NewVerificationService(context servicecontext.ServiceContext, opts ...VerificationServiceOption) service.VerificationService
- type ServiceImpl
- func (s *ServiceImpl) InitVerification(ctx *gin.Context, userID, username, e164PhoneNumber, countryCode string) error
- func (s *ServiceImpl) VerifyActivationCode(ctx *gin.Context, userID, username, code string) error
- func (s *ServiceImpl) VerifyPhoneCode(ctx *gin.Context, userID, username, code string) (verificationErr error)
- type VerificationServiceOption
Constants ¶
const (
TimestampLayout = "2006-01-02T15:04:05.000Z07:00"
)
Variables ¶
This section is empty.
Functions ¶
func NewVerificationService ¶
func NewVerificationService(context servicecontext.ServiceContext, opts ...VerificationServiceOption) service.VerificationService
NewVerificationService creates a service object for performing user verification
Types ¶
type ServiceImpl ¶
type ServiceImpl struct { base.BaseService namespaced.Client HTTPClient *http.Client NotificationService sender.NotificationSender }
ServiceImpl represents the implementation of the verification service.
func (*ServiceImpl) InitVerification ¶
func (s *ServiceImpl) InitVerification(ctx *gin.Context, userID, username, e164PhoneNumber, countryCode string) error
InitVerification sends a verification message to the specified user, using the Twilio service. If successful, the user will receive a verification SMS. The UserSignup resource is updated with a number of annotations in order to manage the phone verification process and protect against system abuse.
func (*ServiceImpl) VerifyActivationCode ¶
func (s *ServiceImpl) VerifyActivationCode(ctx *gin.Context, userID, username, code string) error
VerifyActivationCode verifies the activation code: - checks that the SocialEvent resource named after the activation code exists - checks that the SocialEvent has enough capacity to approve the user
func (*ServiceImpl) VerifyPhoneCode ¶
func (s *ServiceImpl) VerifyPhoneCode(ctx *gin.Context, userID, username, code string) (verificationErr error)
VerifyPhoneCode validates the user's phone verification code. It updates the specified UserSignup value, so even if an error is returned by this function the caller should still process changes to it
type VerificationServiceOption ¶
type VerificationServiceOption func(svc *ServiceImpl)