validator

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidationError

type ValidationError struct {
	Field   string `json:"field"`
	Tag     string `json:"tag"`
	Value   string `json:"value"`
	Message string `json:"message"`
}

type ValidationErrors

type ValidationErrors []ValidationError

func (ValidationErrors) Error

func (v ValidationErrors) Error() string

type Validator

type Validator struct {
	Validator *validator.Validate
}

func DefaultRestValidator

func DefaultRestValidator() *Validator

func (*Validator) RegisterCustomValidation

func (v *Validator) RegisterCustomValidation(tag string, fn validator.Func) error

func (*Validator) RegisterStructValidation

func (v *Validator) RegisterStructValidation(fn validator.StructLevelFunc, types ...any)

func (*Validator) Validate

func (v *Validator) Validate(i any) error

Jump to

Keyboard shortcuts

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