validate

package
v2.1.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Validates = []Validate{
	{
		Tag:         "phone",
		Translation: "{0}为11位手机号",
		Alias:       "numeric,len=11,startswith=1",
	},
	{
		Tag:         "password_simple",
		Translation: "{0}至少满足6位",
		Alias:       "min=6",
	},
}

Functions

func NewAlias

func NewAlias(validate *validator.Validate, date []Validate)

func NewTranslate

func NewTranslate(validate *validator.Validate, date ...Validate) (trans ut.Translator, err error)

func Translate

func Translate(validationErr error) (errs validator.ValidationErrorsTranslations, first error)

Types

type Validate

type Validate struct {
	Tag         string
	Translation string
	Alias       string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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