Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct { UserID string `json:"user_id"` Username string `json:"username"` Lastname string `json:"lastname"` Firstname string `json:"firstname"` jwt.StandardClaims }
Claims are custom claims extending default ones
type User ¶
type User struct { ID string `json:"id" xml:"id" form:"id" gorm:"primaryKey" validate:"required,uuid"` Username string `json:"username" xml:"username" form:"username" gorm:"unique;size:127" validate:"required,email"` Password string `json:"-" xml:"-" form:"password" gorm:"index;size=128" validate:"required,min=8"` // SHA512 Lastname string `json:"lastname" xml:"lastname" form:"lastname" gorm:"size=63" validate:"required"` Firstname string `json:"firstname" xml:"firstname" form:"firstname" gorm:"size=63" validate:"required"` CreatedAt time.Time `json:"created_at" xml:"created_at" form:"created_at" gorm:"autoCreateTime"` UpdatedAt time.Time `json:"updated_at" xml:"updated_at" form:"updated_at" gorm:"autoUpdateTime"` DeletedAt gorm.DeletedAt `json:"-" xml:"-" form:"deleted_at" gorm:"index"` }
User represents a user in database.
type UserForm ¶
type UserForm struct { Username string `json:"username" xml:"username" form:"username" validate:"required,email"` Password string `json:"password" xml:"password" form:"password" validate:"required,min=8"` Lastname string `json:"lastname" xml:"lastname" form:"lastname" validate:"required"` Firstname string `json:"firstname" xml:"firstname" form:"firstname" validate:"required"` }
UserForm is used to create or update a user.
Click to show internal directories.
Click to hide internal directories.