validate

package
v0.0.0-...-3363d21 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomValidator *customValidator

Functions

func New

func New() (cv *customValidator, err error)

*

  • 初始化一个验证器

func WithValidations

func WithValidations(v Validation)

*

  • 添加验证器

Types

type Validation

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

表示 validator.Validate 和 ut.Translator 的组合. 包含验证标签, 方式, 翻译器等基本要素 其中, tag 为必要字段

当存在 translation 时, 其他均为可选, 表示重写一个 tag 的翻译器

Jump to

Keyboard shortcuts

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