service

package
v0.0.0-...-d71fd26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimestampLayout = "2006-01-02T15:04:05.000Z07:00"
)

Variables

This section is empty.

Functions

func NewVerificationService

NewVerificationService creates a service object for performing user verification

Types

type ServiceImpl

type ServiceImpl struct {
	base.BaseService
	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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL