Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserNotFound = errs.NewI18nError("user.notfound").FallBack("user not found").Code(code.ResourceNotFound) ErrUsernameAlreadyUsed = errs.NewI18nError("user.nameUsed").FallBack("username already used") ErrEmailAlreadyUsed = errs.NewI18nError("user.emailUsed").FallBack("email already used") ErrUserAlreadyExists = errs.NewI18nError("user.alreadyExist").FallBack("user already exists") )
View Source
var ( RuleUsername = helper.Rules(is.Alphanumeric, vax.RangeLenRune(6, 20)) RulePassword = helper.Rules(vax.RangeLenRune(10, 30)) )
View Source
var InitialUser = CreateUserOption{
Username: "dstadmin",
Email: "",
Password: "0123456789",
}
Functions ¶
This section is empty.
Types ¶
type CreateUserOption ¶
type CreateUserOption struct { // new username Username string `json:"username" example:"jack"` // new email Email string `json:"email" example:"jack@google.com"` // new password Password string `json:"password" example:"123456"` // new roles Roles []string `json:"roles"` }
func (CreateUserOption) Validate ¶
func (c CreateUserOption) Validate(lang string) error
type PageOption ¶
type PageOption struct { helper.PageOption // specified field Order string `json:"order" uri:"order" form:"order" example:"email"` // search text, should be of one username or email Search string `json:"search" uri:"search" form:"search" example:"jacklove"` }
func (PageOption) Validate ¶
func (p PageOption) Validate(lang string) error
type SaveUserDetailOption ¶
type SaveUserDetailOption struct { UUID string `json:"uuid" example:"55BBA4ED-18D3-790F-EABF-A5330E527586"` // new username Username string `json:"username" example:"jack"` // new email Email string `json:"email" example:"jack@google.com"` // new password Password string `json:"password" example:"123456"` // new roles Roles []string `json:"roles"` }
func (SaveUserDetailOption) Validate ¶
func (u SaveUserDetailOption) Validate(lang string) error
type UpdateInfoOption ¶
type UpdateInfoOption struct { UUID string `json:"-" swaggerignore:"true" example:"55BBA4ED-18D3-790F-EABF-A5330E527586"` // new username Username string `json:"username" example:"jack"` // new email Email string `json:"email" example:"jack@google.com"` // new password Password string `json:"password" example:"123456"` }
func (UpdateInfoOption) Validate ¶
func (u UpdateInfoOption) Validate(lang string) error
Click to show internal directories.
Click to hide internal directories.