Documentation ¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activate ¶
type Activate struct { Authenticate NewPassword string `json:"newPassword" binding:"required,password"` }
Activate is validation struct of using during activate user
type Authenticate ¶
type Authenticate struct { Account string `json:"account" binding:"required,min=8,max=20"` Password string `json:"password" binding:"required,password"` }
Authenticate is validation struct of using during authentication
type Date ¶ added in v1.6.0
func (Date) MarshalJSON ¶ added in v1.6.0
func (*Date) UnmarshalJSON ¶ added in v1.6.0
type GeneratedPassword ¶ added in v1.6.0
type GeneratedPassword struct {
Password string `json:"password"`
}
GeneratedPassword is struct of generated password
type RegistrationUser ¶ added in v1.6.0
type RegistrationUser struct { Account string `json:"account" binding:"required,min=8,max=20"` Name string `json:"name" binding:"required,max=50"` Gender string `json:"gender" binding:"required,oneof=Male Female Unknown"` MailAddress string `json:"mailAddress" binding:"required,email"` Birthday string `json:"birthday" binding:"required,date"` Role *string `json:"role" binding:"omitempty,oneof=Administrator General"` }
RegistrationUser is struct of request data for registration user
type State ¶
type State struct { Status string `json:"status"` Environment string `json:"environment"` LogLevel string `json:"logLevel"` TimeZone string `json:"timezone"` }
State is struct of Application state
type User ¶
type User struct { ID uint `gorm:"primary_key" json:"id"` Account string `gorm:"type:varchar(20);not null;unique_index" json:"account"` Name string `gorm:"type:varchar(50);not null" json:"name"` Password string `gorm:"type:varchar(255);not null" json:"-"` Gender Gender `gorm:"type:enum('Male','Female','Unknown');not null" json:"gender"` MailAddress string `gorm:"type:varchar(255);not null" json:"mailAddress"` Birthday Date `gorm:"type:date;not null" json:"birthday"` Role Role `gorm:"type:enum('Administrator','General');not null"` LastLogged *time.Time `gorm:"type:datetime" json:"-"` IsActive bool `gorm:"type:tinyint;not null" json:"-"` IsEnable bool `gorm:"type:tinyint;not null" json:"-"` CreatedAt time.Time `gorm:"type:datetime;not null" sql:"default:current_timestamp" json:"-"` }
User is struct of authenticated user data
func (*User) DefaultRole ¶ added in v1.6.0
DefaultRole is get user default role
Click to show internal directories.
Click to hide internal directories.