Versions in this module Expand all Collapse all v1 v1.0.0 Nov 7, 2024 Changes in this version + const ERR_ALPHA_DASH + const ERR_ALPHA_DASH_DOT + const ERR_BOOLEAN_TYPE + const ERR_CONTENT_TYPE + const ERR_DEFAULT + const ERR_DESERIALIZATION + const ERR_EMAIL + const ERR_EXCLUDE + const ERR_FLOAT_TYPE + const ERR_IN + const ERR_INCLUDE + const ERR_INTERGER_TYPE + const ERR_MAX_SIZE + const ERR_MIN_SIZE + const ERR_NOT_INT + const ERR_RANGE + const ERR_REQUIRED + const ERR_SIZE + const ERR_URL + var AlphaDashDotPattern = regexp.MustCompile(`[^\d\w-_\.]`) + var AlphaDashPattern = regexp.MustCompile(`[^\d\w-_]`) + var EmailPattern = regexp.MustCompile(...) + var MaxMemory = int64(1024 * 1024 * 10) + var URLPattern = regexp.MustCompile(...) + func AddParamRule(r *ParamRule) + func AddRule(r *Rule) + func SetNameMapper(nm NameMapper) + type Error struct + Classification string + FieldNames []string + Message string + func (e Error) Error() string + func (e Error) Fields() []string + func (e Error) Kind() string + type ErrorHandler interface + Error func(*http.Request, Errors) + type Errors []Error + func Bind(req *http.Request, obj any) Errors + func Form(req *http.Request, formStruct any) Errors + func JSON(req *http.Request, jsonStruct any) Errors + func MultipartForm(req *http.Request, formStruct any) Errors + func RawValidate(obj any) Errors + func Validate(req *http.Request, obj any) Errors + func (e *Errors) Add(fieldNames []string, classification, message string) + func (e *Errors) Has(class string) bool + func (e *Errors) Len() int + type NameMapper func(string) string + type ParamRule struct + IsMatch func(string) bool + IsValid func(Errors, string, string, any) (bool, Errors) + type ParamRuleMapper []*ParamRule + type Rule struct + IsMatch func(string) bool + IsValid func(Errors, string, any) (bool, Errors) + type RuleMapper []*Rule + type Validator interface + Validate func(*http.Request, Errors) Errors