Documentation
¶
Index ¶
- func Email(field, value string) error
- func MaxLen(field, value string, max int) error
- func MinLen(field, value string, min int) error
- func Register(name string, fn ValidatorFunc)
- func Required(field, value string) error
- func SetHooks(next Hooks)
- func Struct(value any) error
- type Errors
- type FieldError
- type Hooks
- type ValidatorFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name string, fn ValidatorFunc)
Register adds a custom validator by name.
Types ¶
type FieldError ¶
FieldError describes a validation failure for a field.
type ValidatorFunc ¶
type ValidatorFunc func(field string, value reflect.Value, param string) *FieldError
ValidatorFunc validates a field with an optional parameter.
Click to show internal directories.
Click to hide internal directories.