valid

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddValidator

func AddValidator(vs ...*Validator)

AddValidator add or reset the validator

func Validation

func Validation(err error) error

Validation convert error to error msg

func ValidationWithTag added in v0.1.15

func ValidationWithTag(err error, tag string) error

Validation convert error to error msg by tag name

Types

type Validator

type Validator struct {
	Tag   string         // tag name
	Msg   string         // error msg
	Field string         // field name
	Func  validator.Func // validator function
}

Validator struct

func NewValidator

func NewValidator(tag, msg string, f validator.Func) *Validator

func NewValidatorWithField added in v0.1.15

func NewValidatorWithField(tag, msg string, f validator.Func, field string) *Validator

Jump to

Keyboard shortcuts

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