Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CreateUser ¶
func CreateUser(user *UserRegisteration) error
func GetUserDetails ¶
func GetUserDetails(c *fiber.Ctx) error
func UserRouter ¶
func UserRouter(router fiber.Router)
Types ¶
type User ¶
type User struct { gorm.Model UserDetails ID uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()" json:"id" validate:"uuid"` PasswordHash string `gorm:"type:varchar(128);not null" json:"password_hash" validate:"required,min=8,max=128"` PasswordSalt string `gorm:"type:varchar(128);not null" json:"password_salt" validate:"required,min=8,max=128"` }
func FindUser ¶
func FindUser(user *UserCredentials) (User, error)
type UserCredentials ¶
type UserDetails ¶
type UserDetails struct { FirstName string `gorm:"type:varchar(128);not null" json:"first_name" validate:"required,min=4,max=128"` LastName string `gorm:"type:varchar(128);not null" json:"last_name" validate:"required,min=4,max=128"` Email string `gorm:"type:varchar(128);not null;unique" json:"email" validate:"required,email,min=4,max=128"` }
type UserRegisteration ¶
type UserRegisteration struct { UserDetails Password string `json:"password" validate:"required,min=8,max=128"` }
Click to show internal directories.
Click to hide internal directories.