validated

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

*

  • @Time : 2020-04-30 16:30
  • @Author : MassAdobe
  • @Description: system

*

*

  • @Time : 2020-04-30 11:36
  • @Author : MassAdobe
  • @Description: system

*

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindAndCheck

func BindAndCheck(c *goContext.Context, data interface{})

*

  • @Author: MassAdobe
  • @TIME: 2020-04-30 16:31
  • @Description: 绑定参数并验证参数

*

func CheckParams

func CheckParams(data interface{})

*

  • @Author: MassAdobe
  • @TIME: 2020-06-01 17:29
  • @Description: 检查参数,一般get请求使用

*

func InitValidator

func InitValidator()

*

  • @Author: MassAdobe
  • @TIME: 2020-04-30 15:46
  • @Description: 初始化验证器

*

Types

type CanCheck

type CanCheck interface {
	Check() error
}

*

  • @Author: MassAdobe
  • @TIME: 2020-04-30 15:51
  • @Description: 如果需要特殊校验,可以实现验证接口,或者通过自定义tag标签实现

*

type Validator

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

*

  • @Author: MassAdobe
  • @TIME: 2020-04-30 15:45
  • @Description: 自定义验证器

*

var GlobalValidator Validator

*

  • @Author: MassAdobe
  • @TIME: 2020-04-30 15:46
  • @Description: 全局验证器

*

func (*Validator) Check

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

*

  • @Author: MassAdobe
  • @TIME: 2020-04-30 15:47
  • @Description: 验证器通用验证方法

*

Jump to

Keyboard shortcuts

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