Documentation
¶
Index ¶
- func ErrMatch[T strings](val T, fieldName string, pattern string) error
- func ErrMax(fieldName string, maxValue any) error
- func ErrMaxLength(fieldName string, maxLength int) error
- func ErrMin(fieldName string, minValue any) error
- func ErrMinLength(fieldName string, minLength int) error
- func ErrRequired(fieldName string) error
- func Field[T any](f T, name string) *field[T]
- func RuleSet(fields ...ruleField) *ruleSet
- func VArray[T any](arr []T) hasLength
- func VMap[T comparable, K any](m map[T]K) hasLength
- func VString(str string) hasLength
- type ErrMatchFn
- type ErrMinMaxFn
- type ErrMinMaxLengthFn
- type ErrRequiredFn
- type RuleFn
- type ValidationRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrMaxLength ¶
func ErrMinLength ¶
func ErrRequired ¶
func VMap ¶
func VMap[T comparable, K any](m map[T]K) hasLength
Types ¶
type ErrMatchFn ¶
type ErrMinMaxFn ¶
type ErrMinMaxLengthFn ¶
type ErrRequiredFn ¶
type RuleFn ¶
type RuleFn[T any] func(*field[T]) ValidationRule
type ValidationRule ¶
func Required ¶
func Required[T any](f *field[T]) ValidationRule
Click to show internal directories.
Click to hide internal directories.