validator

package
v2.0.0-...-fe6a7a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultValidator

type DefaultValidator struct {
	Validator *validator.Validate
}

DefaultValidator implements the Echo#Validator interface.

func NewDefaultValidator

func NewDefaultValidator(v *validator.Validate) (*DefaultValidator, error)

func (*DefaultValidator) Validate

func (dv *DefaultValidator) Validate(data interface{}) error

Validate implements the `Echo#Validator.Validate` function.

type ValidationError

type ValidationError struct {
	Err error
}

ValidationError implements the builtin `error` interface and extends custom output function.

func (*ValidationError) ErrCollection

func (ve *ValidationError) ErrCollection() []map[string]string

ErrCollection formats the validation errors and return it as a slice.

func (*ValidationError) Error

func (ve *ValidationError) Error() string

Error implements the builtin `error.Error` function.

func (*ValidationError) Unwrap

func (ve *ValidationError) Unwrap() error

Unwrap implements the builtin `error.Unwrap` function.

type ValidatorFunc

type ValidatorFunc func(*validator.Validate) error

ValidatorFunc is a custom validator function you can define and add to the validator.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL