validator

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTypeFunc

func RegisterTypeFunc(fn CustomTypeFunc, types ...any)

func RegisterValidationRules

func RegisterValidationRules(rules ...ValidationRule) error

func Validate

func Validate(value any) error

Types

type CustomTypeFunc

type CustomTypeFunc = func(field reflect.Value) any

type ValidationRule

type ValidationRule struct {
	RuleTag                  string
	ErrMessageTemplate       string
	ErrMessageI18nKey        string
	Validate                 func(fl v.FieldLevel) bool
	ParseParam               func(fe v.FieldError) []string
	CallValidationEvenIfNull bool
}

Jump to

Keyboard shortcuts

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