Documentation
¶
Index ¶
- Constants
- type Config
- type Pet
- type User
- func (u *User) CIDRs() (cidrs []*net.IPNet)
- func (u *User) DisplayName() string
- func (u *User) GetPassword() string
- func (u *User) GetUsername() string
- func (u *User) HasRole(role string) bool
- func (u *User) Initials() string
- func (u *User) IsAdmin() bool
- func (u *User) IsApiOnly() bool
- func (u *User) IsDevel() bool
- func (u *User) IsEditor() bool
- func (u *User) IsSuper() bool
- func (u *User) IsViewer() bool
- func (u *User) SetPassword(password string)
- func (u *User) String() string
Constants ¶
View Source
const ( ConfigStyleChecks = "C" ConfigStyleVerticalChecks = "VC" ConfigStyleOrderedChecks = "OC" ConfigStyleRadios = "R" ConfigStyleVerticalRadios = "VR" ConfigStyleSelect = "S" ConfigStyleMultiSelect = "MS" ConfigStyleTextarea = "T" ConfigStyleNumeric = "N" ConfigStyleDecimal = "D" )
View Source
const ( UserStartID = int64(101) RoleSuper = "$" RoleDevel = "%" RoleAdmin = "A" RoleEditor = "E" RoleViewer = "V" RoleApiOnly = "Z" UserActive = "A" UserDisabled = "D" )
View Source
const ( PrefixTmpFile = "t" PrefixJobFile = "j" PrefixPetFile = "p" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string `gorm:"size:64;not null;primaryKey"` Value string `gorm:"not null"` Style string `gorm:"size:2;not null"` Order int `gorm:"not null"` Required bool `gorm:"not null"` Secret bool `gorm:"not null"` Viewer string `gorm:"size:1;not null"` Editor string `gorm:"size:1;not null"` Validation string `gorm:"not null"` CreatedAt time.Time `gorm:"not null;<-:create" json:"created_at"` UpdatedAt time.Time `gorm:"not null;autoUpdateTime:false" json:"updated_at"` }
func (*Config) DisplayValue ¶
func (*Config) IsSameMeta ¶
type Pet ¶
type Pet struct { ID int64 `gorm:"not null;primaryKey;autoIncrement" json:"id" form:"id"` Name string `gorm:"size:100;not null" json:"name" form:"name,strip" validate:"required,maxlen=100"` Gender string `gorm:"size:1;not null" json:"gender" form:"gender,strip" validate:"required"` BornAt time.Time `gorm:"not null" json:"born_at" form:"born_at" validate:"required"` Origin string `gorm:"size:10;not null" json:"origin" form:"origin,strip" validate:"required"` Temper string `gorm:"size:1;not null" json:"temper" form:"temper,strip" validate:"required"` Habits pqx.StringArray `gorm:"type:character(1)[]" json:"habits" form:"habits,strip"` Amount int `gorm:"not null" json:"amount" form:"amount"` Price float64 `gorm:"not null;precision:10;scale:2" json:"price" form:"price"` ShopName string `gorm:"size:200;not null" json:"shop_name" form:"shop_name,strip" validate:"omitempty,maxlen=200"` ShopAddress string `gorm:"size:200;not null" json:"shop_address" form:"shop_address,strip" validate:"omitempty,maxlen=200"` ShopTelephone string `gorm:"size:20;not null" json:"shop_telephone" form:"shop_telephone,strip" validate:"omitempty,maxlen=200"` ShopLink string `gorm:"size:1000;not null" json:"shop_link" form:"shop_link,strip" validate:"omitempty,maxlen=1000,url"` Description string `gorm:"not null" json:"description" form:"description"` CreatedAt time.Time `gorm:"not null;<-:create" json:"created_at"` UpdatedAt time.Time `gorm:"not null;autoUpdateTime:true" json:"updated_at"` }
type User ¶
type User struct { ID int64 `gorm:"not null;primaryKey;autoIncrement" json:"id" form:"id"` Name string `gorm:"size:100;not null" json:"name" form:"name,strip" validate:"required,maxlen=100"` Email string `gorm:"size:200;not null;uniqueIndex:idx_users_email" json:"email" form:"email,strip" validate:"required,maxlen=200,email"` Password string `gorm:"size:200;not null" json:"password" form:"password,strip" validate:"omitempty,printascii"` Role string `gorm:"size:1;not null" json:"role" form:"role,strip" validate:"required"` Status string `gorm:"size:1;not null" json:"status" form:"status,strip" validate:"required"` CIDR string `gorm:"column:cidr;not null" json:"cidr" form:"cidr,strip" validate:"omitempty,cidrs"` Secret int64 `gorm:"not null" json:"secret" form:"secret"` CreatedAt time.Time `gorm:"not null;<-:create" json:"created_at"` UpdatedAt time.Time `gorm:"not null;autoUpdateTime:true" json:"updated_at"` }
func (*User) DisplayName ¶
func (*User) GetPassword ¶
func (*User) GetUsername ¶
func (*User) SetPassword ¶
Click to show internal directories.
Click to hide internal directories.