Skip to content

Instantly share code, notes, and snippets.

@muhammadqazi
Created February 6, 2022 10:42
Show Gist options
  • Save muhammadqazi/70bfd4361537664605b442040013104e to your computer and use it in GitHub Desktop.
Save muhammadqazi/70bfd4361537664605b442040013104e to your computer and use it in GitHub Desktop.
Go-Authentication
type UserModel struct {
ID primitive.ObjectID `bson:"_id"`
First_name string `json:"first_name" validate:"required,min=2,max=100"`
Last_name string `json:"last_name" validate:"required,min=2,max=100"`
Password string `json:"Password" validate:"required,min=6,max=20"`
Email string `json:"email" validate:"email,required"`
Phone int `json:"phone" validate:"required"`
Token string `json:"token"`
Refresh_token string `json:"refresh_token"`
Created_at time.Time `json:"created_at"`
Updated_at time.Time `json:"updated_at"`
User_id string `json:"user_id"`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment