{"modulePath":"github.com/apache/answer","version":"v1.7.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package validator\n\n## Variables\n\n```go\nvar GlobalValidatorMapping = make(map[i18n.Language]*MyValidator, 0)\n```\nGlobalValidatorMapping is a mapping from validator to translator used\n\n## Functions\n\n```go\nfunc NotBlank(fl validator.FieldLevel) (res bool)\n```\n\n```go\nfunc Sanitizer(fl validator.FieldLevel) (res bool)\n```\n\n## Types\n\n```go\ntype Checker interface {\n\tCheck() (errField []*FormErrorField, err error)\n}\n```\nChecker .\n\n```go\ntype FormErrorField struct {\n\tErrorField string `json:\"error_field\"`\n\tErrorMsg   string `json:\"error_msg\"`\n}\n```\nFormErrorField indicates the current form error content. which field is error and error message.\n\n```go\ntype MyValidator struct {\n\tValidate *validator.Validate\n\tTran     ut.Translator\n\tLang     i18n.Language\n}\n```\nMyValidator my validator\n\n```go\nfunc GetValidatorByLang(lang i18n.Language) *MyValidator\n```\n\n```go\nfunc (m *MyValidator) Check(value any) (errFields []*FormErrorField, err error)\n```\nCheck /\n\n```go\ntype TranslatorLocal struct {\n\tLa           i18n.Language\n\tLo           locales.Translator\n\tRegisterFunc func(v *validator.Validate, trans ut.Translator) (err error)\n}\n```\n\n","path":"github.com/apache/answer/internal/base/validator","name":"validator","synopsis":"","isRedistributable":true}
