validate

package
v0.0.0-...-bc6c5c1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TagMap = map[string]Func{
	"required": IsRequired,
	"email":    IsEmail,
	"phone":    IsPhone,
	"label":    IsLabel,
	"number":   IsNumber,
}
View Source
var (
	TagName = "validate"
)

Functions

func IsEmail

func IsEmail(in interface{}) bool

func IsLabel

func IsLabel(in interface{}) bool

func IsNumber

func IsNumber(in interface{}) bool

func IsPhone

func IsPhone(in interface{}) bool

func IsRequired

func IsRequired(in interface{}) bool

func Name

func Name(in reflect.StructField) string

func Struct

func Struct(in interface{}) error

Types

type FieldErr

type FieldErr []string

func (FieldErr) Format

func (f FieldErr) Format(name string) string

type FieldErrs

type FieldErrs map[string]FieldErr

func NewFieldErr

func NewFieldErr(name, errName string) FieldErrs

func (FieldErrs) Error

func (v FieldErrs) Error() string

type Func

type Func func(interface{}) bool

Jump to

Keyboard shortcuts

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