Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComparePasswords ¶
ComparePasswords with plain pw
Types ¶
type CreateUserRequest ¶
type CreateUserRequest struct { Email string `json:"email" valid:"required,email"` Name string `json:"name" valid:"required,stringlength(2|50)"` Username string `json:"username" valid:"required,stringlength(2|50)"` Password string `json:"password" valid:"required,stringlength(8|50)"` }
CreateUserRequest type
type LogingUserRequest ¶
type LogingUserRequest struct { Email string `json:"email" valid:"required,email"` Password string `json:"password" valid:"required"` }
LogingUserRequest type
type User ¶
type User struct { ID uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()"` Name string `gorm:"not null;default: null" json:"name"` Username string `gorm:"unique;not null;default: null" json:"username"` Password string `gorm:"type:varchar(255);not null;default: null" json:"password"` Email string `gorm:"type:varchar(100);unique_index;default: null" json:"email"` Role string `gorm:"not null;default: null" json:"role"` }
User model
func (*User) BeforeCreate ¶
BeforeCreate will set a UUID rather than numeric ID.
Click to show internal directories.
Click to hide internal directories.