validatorV2

package
v1.51.7 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequired    = errors.New("必填")
	ErrNoZero      = errors.New("不能为空")
	ErrEq          = errors.New("必须等于")
	ErrNotEq       = errors.New("不能等于")
	ErrIn          = errors.New("仅允许")
	ErrNotIn       = errors.New("不允许")
	ErrRegex       = errors.New("内容不匹配")
	ErrParseData   = errors.New("解析数据错误")
	ErrInvalidType = errors.New("无效的类型")
)
View Source
var APP struct {
	Validator      Validator
	ValidatorField ValidatorField
}

Functions

func WithFiber

func WithFiber[T any](val T, c *fiber.Ctx, funcs ...ExFunc) (T, []error)

func WithGin

func WithGin[T any](val T, c *gin.Context, funcs ...ExFunc) (T, []error)

Types

type Checker

type Checker interface{ Check() error }

type CheckerBool

type CheckerBool struct {
	// contains filtered or unexported fields
}

func (CheckerBool) Check

func (my CheckerBool) Check() error

type CheckerBoolPtr

type CheckerBoolPtr struct {
	// contains filtered or unexported fields
}

func (CheckerBoolPtr) Check

func (my CheckerBoolPtr) Check() error

type CheckerFloat64

type CheckerFloat64 struct {
	// contains filtered or unexported fields
}

func (CheckerFloat64) Check

func (my CheckerFloat64) Check() error

type CheckerFloat64Ptr

type CheckerFloat64Ptr struct {
	// contains filtered or unexported fields
}

func (CheckerFloat64Ptr) Check

func (my CheckerFloat64Ptr) Check() error

type CheckerInt64

type CheckerInt64 struct {
	// contains filtered or unexported fields
}

func (CheckerInt64) Check

func (my CheckerInt64) Check() error

type CheckerInt64Ptr

type CheckerInt64Ptr struct {
	// contains filtered or unexported fields
}

func (CheckerInt64Ptr) Check

func (my CheckerInt64Ptr) Check() error

type CheckerSlice

type CheckerSlice struct {
	// contains filtered or unexported fields
}

func (CheckerSlice) Check

func (my CheckerSlice) Check() error

type CheckerSlicePtr

type CheckerSlicePtr struct {
	// contains filtered or unexported fields
}

func (CheckerSlicePtr) Check

func (my CheckerSlicePtr) Check() error

type CheckerString

type CheckerString struct {
	// contains filtered or unexported fields
}

func (CheckerString) Check

func (my CheckerString) Check() error

type CheckerStringPtr

type CheckerStringPtr struct {
	// contains filtered or unexported fields
}

func (CheckerStringPtr) Check

func (my CheckerStringPtr) Check() error

type CheckerUint64

type CheckerUint64 struct {
	// contains filtered or unexported fields
}

func (CheckerUint64) Check

func (my CheckerUint64) Check() error

type CheckerUint64Ptr

type CheckerUint64Ptr struct {
	// contains filtered or unexported fields
}

func (CheckerUint64Ptr) Check

func (my CheckerUint64Ptr) Check() error

type ExFunc

type ExFunc func(ins *Validator) error

type Validator

type Validator struct {
	Errors          []error
	ValidatorFields []ValidatorField
	// contains filtered or unexported fields
}

func (Validator) Ex

func (my Validator) Ex(funcs ...ExFunc) Validator

func (Validator) New

func (Validator) New(original any, prefixNames ...string) Validator

type ValidatorField

type ValidatorField struct {
	Error error
	// contains filtered or unexported fields
}

func (ValidatorField) New

Jump to

Keyboard shortcuts

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