Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRequired = errors.New("必填") ErrNotEmpty = errors.New("不能为空") ErrInvalidLength = errors.New("长度错误") ErrInvalidValue = errors.New("内容错误") ErrInvalidFormat = errors.New("格式错误") ErrInvalidType = errors.New("类型错误") )
View Source
var APP struct{ Validator Validator }
Functions ¶
This section is empty.
Types ¶
type Checker ¶ added in v1.54.7
type Checker struct {
// contains filtered or unexported fields
}
Checker 验证器
func (Checker) WrongToString ¶ added in v1.54.7
type FieldInfo ¶
type FieldInfo struct {
Name string // 字段名
Value any // 实际值
Kind reflect.Kind
Type reflect.Type
IsPtr bool // 是否是指针
IsNil bool // 是否为空指针
IsZero bool // 是否是零值
Required bool // 是否必填
VRuleTags anyArrayV2.AnyArray[string] // v-rule tag 的值
VNameTags anyArrayV2.AnyArray[string] // v-name tag 的值
// contains filtered or unexported fields
}
FieldInfo 保存了字段的相关信息。
type FieldRule ¶
type FieldRule struct{ FieldRuleBase }
type FieldRuleBase ¶
type FieldRuleBase struct{ Required string }
Click to show internal directories.
Click to hide internal directories.