Documentation ¶
Index ¶
- func AddValidations(v ...Validation)
- func New() (cv *validate, err error)
- func SetTrans(trans string)
- func Validate(s any, message map[string]string) (bool, map[string]string)
- func ValidateError(s any, message map[string]string) (bool, string)
- func ValidateMap(data map[string]any, rules map[string]any, message map[string]string) (bool, map[string]string)
- func ValidateMapError(data map[string]any, rules map[string]any, message map[string]string) (bool, string)
- func Var(data string, rule string) (bool, error)
- type Validation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateMap ¶ added in v1.0.1002
func ValidateMap(data map[string]any, rules map[string]any, message map[string]string) (bool, map[string]string)
*
- map 验证器
Types ¶
type Validation ¶
type Validation struct {
// contains filtered or unexported fields
}
表示 validator.Validate 和 ut.Translator 的组合. 包含验证标签, 方式, 翻译器等基本要素 其中, tag 为必要字段
当存在 translation 时, 其他均为可选, 表示重写一个 tag 的翻译器
Click to show internal directories.
Click to hide internal directories.