Documentation ¶
Index ¶
- Constants
- type OTPModel
- type TokenDetails
- type TokenPairs
- type UsersModel
- func (us *UsersModel) ClearEmailVerification()
- func (us *UsersModel) ClearOTP()
- func (us *UsersModel) ClearPhoneVerification()
- func (us *UsersModel) ComparePassword(password string) (bool, error)
- func (us *UsersModel) IsActive() bool
- func (us *UsersModel) IsEmailConfirmResendAvailable() error
- func (us *UsersModel) IsEmailEqual(identity string) bool
- func (us *UsersModel) IsOTPResendAvailable() error
- func (us *UsersModel) IsPhoneConfirmResendAvailable() error
- func (us *UsersModel) IsPhoneEqual(identity string) bool
- func (us *UsersModel) SetInfo(firstname, lastname string)
- func (us *UsersModel) SetPassword(password string) error
- func (us *UsersModel) UpdateEmail(email string)
- func (us *UsersModel) UpdateEmailVerification(email, code string)
- func (us *UsersModel) UpdateOTP(identity, code string)
- func (us *UsersModel) UpdatePhone(phone string)
- func (us *UsersModel) UpdatePhoneVerification(phone, code string)
- func (us *UsersModel) VerifyIdentity(identity, code string) error
- func (us *UsersModel) VerifyOTP(phone string, code string) error
- type VerificationModel
Constants ¶
View Source
const ( ActiveStatus = "active" DeletedStatus = "deleted" BlockedStatus = "blocked" )
View Source
const (
CollectionUsers = "users"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenDetails ¶
type TokenPairs ¶
type TokenPairs struct { AccessToken *TokenDetails RefreshToken *TokenDetails }
type UsersModel ¶
type UsersModel struct { Id primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"` FirstName string `json:"first_name" bson:"first_name"` LastName string `json:"last_name" bson:"last_name"` Email string `json:"email,omitempty" bson:"email"` Phone string `json:"phone,omitempty" bson:"phone"` Password string `json:"password,omitempty" bson:"password"` Verification VerificationModel `json:"verification,omitempty" bson:"verification"` OTP OTPModel `json:"otp,omitempty" bson:"otp"` Status string `json:"status,omitempty" bson:"status"` CreatedAt time.Time `json:"created_at,omitempty" bson:"created_at"` UpdatedAt time.Time `json:"updated_at,omitempty" bson:"updated_at"` DeletedAt time.Time `json:"deleted_at,omitempty" bson:"deleted_at"` }
func (*UsersModel) ClearEmailVerification ¶
func (us *UsersModel) ClearEmailVerification()
func (*UsersModel) ClearOTP ¶
func (us *UsersModel) ClearOTP()
func (*UsersModel) ClearPhoneVerification ¶
func (us *UsersModel) ClearPhoneVerification()
func (*UsersModel) ComparePassword ¶
func (us *UsersModel) ComparePassword(password string) (bool, error)
func (*UsersModel) IsActive ¶
func (us *UsersModel) IsActive() bool
func (*UsersModel) IsEmailConfirmResendAvailable ¶
func (us *UsersModel) IsEmailConfirmResendAvailable() error
func (*UsersModel) IsEmailEqual ¶
func (us *UsersModel) IsEmailEqual(identity string) bool
func (*UsersModel) IsOTPResendAvailable ¶
func (us *UsersModel) IsOTPResendAvailable() error
func (*UsersModel) IsPhoneConfirmResendAvailable ¶
func (us *UsersModel) IsPhoneConfirmResendAvailable() error
func (*UsersModel) IsPhoneEqual ¶
func (us *UsersModel) IsPhoneEqual(identity string) bool
func (*UsersModel) SetInfo ¶
func (us *UsersModel) SetInfo(firstname, lastname string)
func (*UsersModel) SetPassword ¶
func (us *UsersModel) SetPassword(password string) error
func (*UsersModel) UpdateEmail ¶
func (us *UsersModel) UpdateEmail(email string)
func (*UsersModel) UpdateEmailVerification ¶
func (us *UsersModel) UpdateEmailVerification(email, code string)
func (*UsersModel) UpdateOTP ¶
func (us *UsersModel) UpdateOTP(identity, code string)
func (*UsersModel) UpdatePhone ¶
func (us *UsersModel) UpdatePhone(phone string)
func (*UsersModel) UpdatePhoneVerification ¶
func (us *UsersModel) UpdatePhoneVerification(phone, code string)
func (*UsersModel) VerifyIdentity ¶
func (us *UsersModel) VerifyIdentity(identity, code string) error
type VerificationModel ¶
type VerificationModel struct { NewPhone string `json:"new_phone" bson:"new_phone"` NewPhoneCode string `json:"new_phone_code" bson:"new_phone_code"` NewPhoneDate time.Time `json:"new_phone_date,omitempty" bson:"new_phone_date"` NewEmail string `json:"new_email" bson:"new_email"` NewEmailCode string `json:"new_email_code" bson:"new_email_code"` NewEmailDate time.Time `json:"new_email_date,omitempty" bson:"new_email_date"` }
Click to show internal directories.
Click to hide internal directories.