Documentation
¶
Index ¶
- func ValidateProfileChangePassworRequest(dirtyData *ProfileChangePasswordRequestIDO) error
- type DashboardResponseIDO
- type ExecutiveVisitsTenantRequest
- type GatewayController
- type GatewayControllerImpl
- func (impl *GatewayControllerImpl) Dashboard(ctx context.Context) (*DashboardResponseIDO, error)
- func (impl *GatewayControllerImpl) DisableOTP(ctx context.Context) (*u_d.User, error)
- func (impl *GatewayControllerImpl) ExecutiveVisitsTenant(ctx context.Context, req *ExecutiveVisitsTenantRequest) error
- func (impl *GatewayControllerImpl) ForgotPassword(ctx context.Context, email string) error
- func (impl *GatewayControllerImpl) GenerateOTP(ctx context.Context) (*OTPGenerateResponseIDO, error)
- func (impl *GatewayControllerImpl) GenerateOTPAndQRCodePNGImage(ctx context.Context) ([]byte, error)
- func (impl *GatewayControllerImpl) GetUserBySessionID(ctx context.Context, sessionID string) (*user_s.User, error)
- func (impl *GatewayControllerImpl) Login(ctx context.Context, email, password string) (*gateway_s.LoginResponseIDO, error)
- func (impl *GatewayControllerImpl) Logout(ctx context.Context) error
- func (impl *GatewayControllerImpl) PasswordReset(ctx context.Context, code string, password string) error
- func (impl *GatewayControllerImpl) Profile(ctx context.Context) (*user_s.User, error)
- func (impl *GatewayControllerImpl) ProfileChangePassword(ctx context.Context, req *ProfileChangePasswordRequestIDO) error
- func (impl *GatewayControllerImpl) ProfileUpdate(ctx context.Context, nu *user_s.User) error
- func (impl *GatewayControllerImpl) RefreshToken(ctx context.Context, value string) (*user_s.User, string, time.Time, string, time.Time, error)
- func (impl *GatewayControllerImpl) UserRegister(ctx context.Context, req *UserRegisterRequestIDO) (*gateway_s.LoginResponseIDO, error)
- func (impl *GatewayControllerImpl) ValidateOTP(ctx context.Context, req *ValidateTokenRequestIDO) (*ValidateTokenResponseIDO, error)
- func (impl *GatewayControllerImpl) VerifyOTP(ctx context.Context, req *VerificationTokenRequestIDO) (*VerificationTokenResponseIDO, error)
- type OTPGenerateResponseIDO
- type ProfileChangePasswordRequestIDO
- type UserRegisterRequestIDO
- type UserRegisterResponseIDO
- type ValidateTokenRequestIDO
- type ValidateTokenResponseIDO
- type VerificationTokenRequestIDO
- type VerificationTokenResponseIDO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateProfileChangePassworRequest ¶
func ValidateProfileChangePassworRequest(dirtyData *ProfileChangePasswordRequestIDO) error
Types ¶
type DashboardResponseIDO ¶
type GatewayController ¶
type GatewayController interface {
UserRegister(ctx context.Context, req *UserRegisterRequestIDO) (*gateway_s.LoginResponseIDO, error)
Login(ctx context.Context, email, password string) (*gateway_s.LoginResponseIDO, error)
GetUserBySessionID(ctx context.Context, sessionID string) (*user_s.User, error)
RefreshToken(ctx context.Context, value string) (*user_s.User, string, time.Time, string, time.Time, error)
Logout(ctx context.Context) error
ForgotPassword(ctx context.Context, email string) error
PasswordReset(ctx context.Context, code string, password string) error
Profile(ctx context.Context) (*user_s.User, error)
ProfileUpdate(ctx context.Context, nu *user_s.User) error
ProfileChangePassword(ctx context.Context, req *ProfileChangePasswordRequestIDO) error
ExecutiveVisitsTenant(ctx context.Context, req *ExecutiveVisitsTenantRequest) error
Dashboard(ctx context.Context) (*DashboardResponseIDO, error)
GenerateOTP(ctx context.Context) (*OTPGenerateResponseIDO, error)
GenerateOTPAndQRCodePNGImage(ctx context.Context) ([]byte, error)
VerifyOTP(ctx context.Context, req *VerificationTokenRequestIDO) (*VerificationTokenResponseIDO, error)
ValidateOTP(ctx context.Context, req *ValidateTokenRequestIDO) (*ValidateTokenResponseIDO, error)
DisableOTP(ctx context.Context) (*u_d.User, error)
}
func NewController ¶
func NewController( appCfg *config.Conf, loggerp *slog.Logger, uuidp uuid.Provider, jwtp jwt.Provider, passwordp password.Provider, kmux kmutex.Provider, cache mongodbcache.Cacher, te templatedemailer.TemplatedEmailer, client *mongo.Client, usr_storer user_s.UserStorer, org_storer tenant_s.TenantStorer, howhear_s howhear_s.HowHearAboutUsItemStorer, ) GatewayController
type GatewayControllerImpl ¶
type GatewayControllerImpl struct {
Config *config.Conf
Logger *slog.Logger
UUID uuid.Provider
JWT jwt.Provider
Password password.Provider
Kmutex kmutex.Provider
DbClient *mongo.Client
Cache mongodbcache.Cacher
TemplatedEmailer templatedemailer.TemplatedEmailer
UserStorer user_s.UserStorer
TenantStorer tenant_s.TenantStorer
HowHearAboutUsItemStorer howhear_s.HowHearAboutUsItemStorer
}
func (*GatewayControllerImpl) Dashboard ¶
func (impl *GatewayControllerImpl) Dashboard(ctx context.Context) (*DashboardResponseIDO, error)
func (*GatewayControllerImpl) DisableOTP ¶
DisableOTP function disables 2FA.
func (*GatewayControllerImpl) ExecutiveVisitsTenant ¶
func (impl *GatewayControllerImpl) ExecutiveVisitsTenant(ctx context.Context, req *ExecutiveVisitsTenantRequest) error
func (*GatewayControllerImpl) ForgotPassword ¶
func (impl *GatewayControllerImpl) ForgotPassword(ctx context.Context, email string) error
func (*GatewayControllerImpl) GenerateOTP ¶
func (impl *GatewayControllerImpl) GenerateOTP(ctx context.Context) (*OTPGenerateResponseIDO, error)
GenerateOTP function generates the time-based one-time password (TOTP) secret for the user. The user must use these values to generate a QR to present to the user.
func (*GatewayControllerImpl) GenerateOTPAndQRCodePNGImage ¶
func (impl *GatewayControllerImpl) GenerateOTPAndQRCodePNGImage(ctx context.Context) ([]byte, error)
func (*GatewayControllerImpl) GetUserBySessionID ¶
func (*GatewayControllerImpl) Login ¶
func (impl *GatewayControllerImpl) Login(ctx context.Context, email, password string) (*gateway_s.LoginResponseIDO, error)
func (*GatewayControllerImpl) Logout ¶
func (impl *GatewayControllerImpl) Logout(ctx context.Context) error
func (*GatewayControllerImpl) PasswordReset ¶
func (*GatewayControllerImpl) ProfileChangePassword ¶
func (impl *GatewayControllerImpl) ProfileChangePassword(ctx context.Context, req *ProfileChangePasswordRequestIDO) error
func (*GatewayControllerImpl) ProfileUpdate ¶
func (*GatewayControllerImpl) RefreshToken ¶
func (*GatewayControllerImpl) UserRegister ¶
func (impl *GatewayControllerImpl) UserRegister(ctx context.Context, req *UserRegisterRequestIDO) (*gateway_s.LoginResponseIDO, error)
func (*GatewayControllerImpl) ValidateOTP ¶
func (impl *GatewayControllerImpl) ValidateOTP(ctx context.Context, req *ValidateTokenRequestIDO) (*ValidateTokenResponseIDO, error)
ValidateOTP function verifies provided token from the third-party authenticator app. The purpose of this function is enable the loggin for 2FA.
func (*GatewayControllerImpl) VerifyOTP ¶
func (impl *GatewayControllerImpl) VerifyOTP(ctx context.Context, req *VerificationTokenRequestIDO) (*VerificationTokenResponseIDO, error)
VerifyOTP function verifies provided token from the third-party authenticator app. The purpose of this function is to finish the otp setup.
type OTPGenerateResponseIDO ¶
type UserRegisterRequestIDO ¶
type UserRegisterRequestIDO struct {
TenantID primitive.ObjectID `json:"tenant_id,omitempty"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Email string `json:"email"`
EmailRepeated string `json:"email_repeated"`
IsOkToEmail bool `json:"is_ok_to_email"`
Password string `json:"password"`
PasswordRepeated string `json:"password_repeated"`
Phone string `json:"phone,omitempty"`
PhoneType int8 `json:"phone_type"`
PhoneExtension string `json:"phone_extension"`
IsOkToText bool `json:"is_ok_to_text"`
OtherPhone string `json:"other_phone"`
OtherPhoneExtension string `json:"other_phone_extension"`
OtherPhoneType int8 `json:"other_phone_type"`
Country string `json:"country,omitempty"`
Region string `json:"region,omitempty"`
City string `json:"city,omitempty"`
PostalCode string `json:"postal_code,omitempty"`
AddressLine1 string `json:"address_line_1,omitempty"`
AddressLine2 string `json:"address_line_2,omitempty"`
StoreLogo string `json:"store_logo,omitempty"`
HowDidYouHearAboutUsID primitive.ObjectID `bson:"how_did_you_hear_about_us_id" json:"how_did_you_hear_about_us_id,omitempty"`
HowDidYouHearAboutUsText string `bson:"how_did_you_hear_about_us_text" json:"how_did_you_hear_about_us_text,omitempty"`
IsHowDidYouHearAboutUsOther bool `bson:"is_how_did_you_hear_about_us_other" json:"is_how_did_you_hear_about_us_other,omitempty"`
HowDidYouHearAboutUsOther string `bson:"how_did_you_hear_about_us_other" json:"how_did_you_hear_about_us_other,omitempty"`
AgreeTOS bool `bson:"agree_tos" json:"agree_tos,omitempty"`
AgreePromotionsEmail bool `json:"agree_promotions_email,omitempty"`
AgreeWaiver bool `bson:"agree_waiver" json:"agree_waiver,omitempty"`
HasShippingAddress bool `bson:"has_shipping_address" json:"has_shipping_address,omitempty"`
ShippingName string `bson:"shipping_name" json:"shipping_name,omitempty"`
ShippingPhone string `bson:"shipping_phone" json:"shipping_phone,omitempty"`
ShippingCountry string `bson:"shipping_country" json:"shipping_country,omitempty"`
ShippingRegion string `bson:"shipping_region" json:"shipping_region,omitempty"`
ShippingCity string `bson:"shipping_city" json:"shipping_city,omitempty"`
ShippingPostalCode string `bson:"shipping_postal_code" json:"shipping_postal_code,omitempty"`
ShippingAddressLine1 string `bson:"shipping_address_line1" json:"shipping_address_line1,omitempty"`
ShippingAddressLine2 string `bson:"shipping_address_line2" json:"shipping_address_line2,omitempty"`
HasCouponPromotionalCode int8 `json:"has_coupon_promotional_code,omitempty"`
CouponPromotionalCode string `bson:"coupon_promotional_code" json:"coupon_promotional_code,omitempty"`
BirthDate time.Time `json:"birth_date"`
JoinDate time.Time `json:"join_date"`
Gender int8 `bson:"gender" json:"gender"`
GenderOther string `bson:"gender_other" json:"gender_other"`
}
type UserRegisterResponseIDO ¶
type ValidateTokenRequestIDO ¶
type ValidateTokenRequestIDO struct {
Token string `json:"token"`
}
type VerificationTokenRequestIDO ¶
type VerificationTokenRequestIDO struct {
VerificationToken string `json:"verification_token"`
}
Click to show internal directories.
Click to hide internal directories.