Documentation ¶
Index ¶
- func CheckBankAddress(address string) bool
- func CheckBankBranch(branch string) bool
- func CheckBankCard(bankCard string) bool
- func CheckCVCode(code string) bool
- func CheckCVID(id string) bool
- func CheckDateFormat(date string) bool
- func CheckDeviceID(deviceID string) bool
- func CheckDirFormat(dir string) bool
- func CheckEmail(email string) bool
- func CheckHttpUrl(url string) bool
- func CheckIP(ip string) bool
- func CheckPassword(password string) bool
- func CheckPhoneNumber(phone string) bool
- func CheckRealName(realName string) bool
- func CheckUserName(userName string) bool
- func CheckVCode(code string) bool
- func CheckVType(vType string) bool
- func FormatEmail(email string) string
- func FormatPhoneNumber(number string) string
- func IsBankCard(cardNumber string) bool
- func IsDeviceNumber(deviceNumber string) bool
- func IsMail(mail string) bool
- func IsPhoneNumber(phone string) bool
- func IsUserName(userName string) bool
- func Verify(obj interface{}) error
- type Validator
- func (ths *Validator) AppendError(message string) *Validator
- func (ths *Validator) BankCard(args ...string) *Validator
- func (ths *Validator) Check(message string, callback func(interface{}) error) *Validator
- func (ths *Validator) CheckReg(regex string, message string) *Validator
- func (ths *Validator) Date(message string) *Validator
- func (ths *Validator) DateTime(message string) *Validator
- func (ths *Validator) Equal(field string, args ...string) *Validator
- func (ths *Validator) Field(name string) *Validator
- func (ths *Validator) Gender(args ...string) *Validator
- func (ths *Validator) InIntValues(values []int, message string) *Validator
- func (ths *Validator) InValues(values []string, message string) *Validator
- func (ths *Validator) Int(message string) *Validator
- func (ths *Validator) Length(min int, max int, message string) *Validator
- func (ths *Validator) Mail(args ...string) *Validator
- func (ths *Validator) Mobile(args ...string) *Validator
- func (ths *Validator) Null(args ...bool) *Validator
- func (ths *Validator) Numeric(message string) *Validator
- func (ths *Validator) NumericEq0(message string) *Validator
- func (ths *Validator) NumericGt0(message string) *Validator
- func (ths *Validator) Password(args ...string) *Validator
- func (ths *Validator) State(args ...string) *Validator
- func (ths *Validator) Time(message string) *Validator
- func (ths *Validator) Uint(message string) *Validator
- func (ths *Validator) Uint0(message string) *Validator
- func (ths *Validator) UserName(args ...string) *Validator
- func (ths *Validator) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
CheckPassword 校验密码 6-12位字母或数字 密码md5 32位
Types ¶
type Validator ¶
type Validator struct { Data map[string]interface{} //要校验的字段 Errors []string //错误信息 FieldName string //当前字段 Required bool //当前字段是否允许为空 }
Validator 校验器
func (*Validator) AppendError ¶
AppendError 追加错误信息
func (*Validator) InIntValues ¶
InIntValues 值在区间范围之内(整形)
func (*Validator) NumericEq0 ¶
Numeric 是数字, 可以为整数,小数,大于等于0
func (*Validator) NumericGt0 ¶
Numeric 是数字, 可以为整数,小数,大于0
Click to show internal directories.
Click to hide internal directories.