xvalidator

package
v1.27.5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatError

func FormatError(request any, err error) error

func FormatValidatorError added in v1.26.3

func FormatValidatorError(request Validator, err error, tag string) error

func RegisterCustomValidation

func RegisterCustomValidation(cv ...*CustomValidator)

RegisterCustomValidation 注册自定义验证器,非线程安全

Types

type CustomValidator

type CustomValidator struct {
	Tag  string
	Func validator.Func
}

type Validator

type Validator interface {
	GetMessages() map[string]map[string]error
}

Jump to

Keyboard shortcuts

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