Versions in this module Expand all Collapse all v10 v10.10.10 Jun 23, 2022 Changes in this version + type CustomTypeFunc func(field reflect.Value) interface + type FieldError interface + ActualTag func() string + Error func() string + Field func() string + Kind func() reflect.Kind + Namespace func() string + Param func() string + StructField func() string + StructNamespace func() string + Tag func() string + Translate func(ut ut.Translator) string + Type func() reflect.Type + Value func() interface{} + type FieldLevel interface + ExtractType func(field reflect.Value) (value reflect.Value, kind reflect.Kind, nullable bool) + Field func() reflect.Value + FieldName func() string + GetStructFieldOK func() (reflect.Value, reflect.Kind, bool) + GetStructFieldOK2 func() (reflect.Value, reflect.Kind, bool, bool) + GetStructFieldOKAdvanced func(val reflect.Value, namespace string) (reflect.Value, reflect.Kind, bool) + GetStructFieldOKAdvanced2 func(val reflect.Value, namespace string) (reflect.Value, reflect.Kind, bool, bool) + GetTag func() string + Param func() string + Parent func() reflect.Value + StructFieldName func() string + Top func() reflect.Value + type FilterFunc func(ns []byte) bool + type Func func(fl FieldLevel) bool + type FuncCtx func(ctx context.Context, fl FieldLevel) bool + type InvalidValidationError struct + Type reflect.Type + func (e *InvalidValidationError) Error() string + type RegisterTranslationsFunc func(ut ut.Translator) error + type StructLevel interface + Current func() reflect.Value + ExtractType func(field reflect.Value) (value reflect.Value, kind reflect.Kind, nullable bool) + Parent func() reflect.Value + ReportError func(field interface{}, fieldName, structFieldName string, tag, param string) + ReportValidationErrors func(relativeNamespace, relativeActualNamespace string, errs ValidationErrors) + Top func() reflect.Value + Validator func() *Validate + type StructLevelFunc func(sl StructLevel) + type StructLevelFuncCtx func(ctx context.Context, sl StructLevel) + type TagNameFunc func(field reflect.StructField) string + type TranslationFunc func(ut ut.Translator, fe FieldError) string + type Validate struct + func New() *Validate + func (v *Validate) RegisterAlias(alias, tags string) + func (v *Validate) RegisterCustomTypeFunc(fn CustomTypeFunc, types ...interface{}) + func (v *Validate) RegisterStructValidation(fn StructLevelFunc, types ...interface{}) + func (v *Validate) RegisterStructValidationCtx(fn StructLevelFuncCtx, types ...interface{}) + func (v *Validate) RegisterStructValidationMapRules(rules map[string]string, types ...interface{}) + func (v *Validate) RegisterTagNameFunc(fn TagNameFunc) + func (v *Validate) RegisterTranslation(tag string, trans ut.Translator, registerFn RegisterTranslationsFunc, ...) (err error) + func (v *Validate) RegisterValidation(tag string, fn Func, callValidationEvenIfNull ...bool) error + func (v *Validate) RegisterValidationCtx(tag string, fn FuncCtx, callValidationEvenIfNull ...bool) error + func (v *Validate) SetTagName(name string) + func (v *Validate) SetTipName(name string) + func (v *Validate) Struct(s interface{}) error + func (v *Validate) StructCtx(ctx context.Context, s interface{}) (err error) + func (v *Validate) StructExcept(s interface{}, fields ...string) error + func (v *Validate) StructExceptCtx(ctx context.Context, s interface{}, fields ...string) (err error) + func (v *Validate) StructFiltered(s interface{}, fn FilterFunc) error + func (v *Validate) StructFilteredCtx(ctx context.Context, s interface{}, fn FilterFunc) (err error) + func (v *Validate) StructPartial(s interface{}, fields ...string) error + func (v *Validate) StructPartialCtx(ctx context.Context, s interface{}, fields ...string) (err error) + func (v *Validate) ValidateMap(data map[string]interface{}, rules map[string]interface{}) map[string]interface{} + func (v *Validate) Var(field interface{}, tag string, tip ...string) error + func (v *Validate) VarCtx(ctx context.Context, field interface{}, tag string, tip ...string) (err error) + func (v *Validate) VarWithValue(field interface{}, other interface{}, tag string) error + func (v *Validate) VarWithValueCtx(ctx context.Context, field interface{}, other interface{}, tag string, ...) (err error) + func (v Validate) ValidateMapCtx(ctx context.Context, data map[string]interface{}, rules map[string]interface{}) map[string]interface{} + type ValidationErrors []FieldError + func (ve ValidationErrors) Error() string + func (ve ValidationErrors) Translate(ut ut.Translator) ValidationErrorsTranslations + type ValidationErrorsTranslations map[string]string Other modules containing this package github.com/wuyan94zl/validator