validator

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeValidator

func InitializeValidator()

InitializeValidator 初始化验证器

Types

type Validator

type Validator struct {
	Validate *validator.Validate
	Trans    ut.Translator
}

Validator 验证器

var Instantiate *Validator

Instantiate 实例

func (*Validator) AddTranslation

func (c *Validator) AddTranslation(tag string, errMessage string)

AddTranslation 添加翻译文本

func (*Validator) RegisterTagNameFunc

func (c *Validator) RegisterTagNameFunc()

RegisterTagNameFunc 注册Tag名称方法

func (*Validator) Struct

func (c *Validator) Struct(s any) error

Struct 验证结构体

Jump to

Keyboard shortcuts

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