Documentation
¶
Index ¶
- func Struct[T any](ctx context.Context, obj T, fieldRules ...FieldRule[T]) error
- func TranslateError(ctx validatecontext.Context, err error) error
- type FieldRule
- func Field[T any, V any](structField field.StructField[T, V], rules ...Rule[V]) FieldRule[T]
- func If[T any](ifFunc func(v T) bool, fieldRules ...FieldRule[T]) FieldRule[T]
- func IfFieldTypeOf[R any, T any, V any](structField field.StructField[T, V], fieldRules ...FieldRule[R]) FieldRule[T]
- func ObjectField[T any, V any](structField field.StructField[T, V], fieldRules ...FieldRule[V]) FieldRule[T]
- func ObjectSliceField[T any, V any](field field.StructField[T, []V], fieldRules ...FieldRule[V]) FieldRule[T]
- func SliceField[T any, V any](field field.StructField[T, []V], rules ...Rule[V]) FieldRule[T]
- type Rule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TranslateError ¶
func TranslateError(ctx validatecontext.Context, err error) error
Types ¶
type FieldRule ¶
type FieldRule[T any] interface { Validate(ctx validatecontext.Context, obj T) *errors.FieldError }
func IfFieldTypeOf ¶
func ObjectField ¶
func ObjectSliceField ¶
func SliceField ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.