Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Credentials ¶
type Credentials struct { Email string `json:"email" binding:"required"` Password string `json:"password" binding:"required"` }
Credentials stores the username and password provided in the request
type EmailSignup ¶
type EmailSignup struct { Email string `json:"email" binding:"required,min=3,email"` Password string `json:"password" binding:"required,min=8"` PasswordConfirm string `json:"password_confirm" binding:"required"` }
EmailSignup contains the user signup request
func AccountSignup ¶
func AccountSignup(c *gin.Context) (*EmailSignup, error)
AccountSignup validates user signup request
type MobileSignup ¶
type MobileSignup struct { CountryCode string `json:"country_code" binding:"required,min=2"` Mobile string `json:"mobile" binding:"required"` }
MobileSignup contains the user signup request with a mobile number
type MobileVerify ¶
type MobileVerify struct { CountryCode string `json:"country_code" binding:"required,min=2"` Mobile string `json:"mobile" binding:"required"` Code string `json:"code" binding:"required"` Signup bool `json:"signup" binding:"required"` }
MobileVerify contains the user's mobile verification country code, mobile number and verification code
func AccountVerifyMobile ¶
func AccountVerifyMobile(c *gin.Context) (*MobileVerify, error)
AccountVerifyMobile validates user mobile verification
type Pagination ¶
type Pagination struct { Limit int `form:"limit"` Page int `form:"page" binding:"min=0"` Offset int `json:"-"` }
Pagination contains pagination request
type Password ¶
type Password struct { ID int `json:"-"` OldPassword string `json:"old_password" binding:"required,min=8"` NewPassword string `json:"new_password" binding:"required,min=8"` NewPasswordConfirm string `json:"new_password_confirm" binding:"required"` }
Password contains password change request
type RegisterAdmin ¶
type RegisterAdmin struct { FirstName string `json:"first_name" binding:"required"` LastName string `json:"last_name" binding:"required"` Username string `json:"username" binding:"required,min=3,alphanum"` Password string `json:"password" binding:"required,min=8"` PasswordConfirm string `json:"password_confirm" binding:"required"` Email string `json:"email" binding:"required,email"` CompanyID int `json:"company_id" binding:"required"` LocationID int `json:"location_id" binding:"required"` RoleID int `json:"role_id" binding:"required"` }
RegisterAdmin contains admin registration request
func AccountCreate ¶
func AccountCreate(c *gin.Context) (*RegisterAdmin, error)
AccountCreate validates account creation request
type UpdateUser ¶
type UpdateUser struct { ID int `json:"-"` FirstName *string `json:"first_name,omitempty" binding:"omitempty,min=2"` LastName *string `json:"last_name,omitempty" binding:"omitempty,min=2"` Mobile *string `json:"mobile,omitempty"` Phone *string `json:"phone,omitempty"` Address *string `json:"address,omitempty"` }
UpdateUser contains user update data from json request
func UserUpdate ¶
func UserUpdate(c *gin.Context) (*UpdateUser, error)
UserUpdate validates user update request