validateToolkit

package
v0.0.0-...-45587e9 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnTrans

func EnTrans() ut.Translator

func New

func New(tagNames ...string) *validator.Validate

New 返回 validator.Validate 实例 不传参,默认使用 validate tag,传参使用第一个作为 tag name

func Struct

func Struct(s interface{}) error

func StructCtx

func StructCtx(ctx context.Context, s interface{}) error

func ValidateMap

func ValidateMap(data map[string]interface{}, rules map[string]interface{}) map[string]interface{}

func ValidateMapCtx

func ValidateMapCtx(ctx context.Context, data map[string]interface{}, rules map[string]interface{}) map[string]interface{}

func ValidateVar

func ValidateVar(field interface{}, tag string) error

func ValidateVarCtx

func ValidateVarCtx(ctx context.Context, field interface{}, tag string) error

func ValidateVarWithValue

func ValidateVarWithValue(field interface{}, other interface{}, tag string) error

func ValidateVarWithValueCtx

func ValidateVarWithValueCtx(ctx context.Context, field interface{}, other interface{}, tag string) error

func ZhTrans

func ZhTrans() ut.Translator

Types

This section is empty.

Jump to

Keyboard shortcuts

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