Documentation ¶
Overview ¶
Package vldz provides various utilities for validating data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustRegisterValidator ¶
func MustRegisterValidator(tag string, validator validator.Func)
MustRegisterValidator registers a validator.
func MustValidateStruct ¶
func MustValidateStruct(v any)
MustValidateStruct is like ValidateStruct but panics on error.
func RegexpValidatorFactory ¶
RegexpValidatorFactory creates a validator that matches a string against the given regexp.
Types ¶
type ValidationError ¶
type ValidationError struct {
// contains filtered or unexported fields
}
ValidationError describes a validation error.
func NewValidationError ¶
func NewValidationError(err error) *ValidationError
NewValidationError initializes a new validation error.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) MaybeGetFieldsSummary ¶
func (e *ValidationError) MaybeGetFieldsSummary() map[string]any
MaybeGetFieldsSummary returns the fields summary if available.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errorz.UnwrapSingle interface.
Click to show internal directories.
Click to hide internal directories.