Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultRule ¶
type DefaultRule struct {
// contains filtered or unexported fields
}
内置规则结构 实现ValidateRuler接口
func (*DefaultRule) Check ¶
func (n *DefaultRule) Check(data interface{}) (err error)
common rule
字段值转换成string进行验证
type ValidateRuler ¶
type ValidateRuler interface { // 验证字段 Check(data interface{}) error }
校验规则接口 支持自定义规则
Click to show internal directories.
Click to hide internal directories.