validator

package
v0.0.0-...-35a45e1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2019 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitValidator

func InitValidator()

InitValidator 初始化验证器

Types

type CanCheck

type CanCheck interface {
	Check() error
}

CanCheck 如果需要特殊校验,可以实现验证接口,或者通过自定义tag标签实现

type MyValidator

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

MyValidator 自定义验证器

var GlobalValidator MyValidator

GlobalValidator 全局验证器

func (*MyValidator) Check

func (m *MyValidator) Check(value interface{}) error

Check 验证器通用验证方法

Jump to

Keyboard shortcuts

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