validate

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEmpty

func IsEmpty(s interface{}) bool

IsEmpty 检查值是否是空

Types

type E

type E struct {
	Status int
	Code   int
	Msg    string
}

E 返回的错误信息

func Email

func Email(v string, isRequired bool, name string) (E, bool)

Email 检查是否是Email

func IDCard

func IDCard(v string, isRequired bool, name string) (E, bool)

IDCard 身份证

func MinLength

func MinLength(v string, length int, name string) (E, bool)

MinLength 字符的最小长度

func Mobile

func Mobile(v string, isRequired bool, name string) (E, bool)

Mobile 手机号码

func RealName

func RealName(v string, isRequired bool, name string) (E, bool)

RealName 汉字姓名

func Required

func Required(v interface{}, name string) (E, bool)

Required 检查是否为空

func UUID

func UUID(v string, isRequired bool, name string) (E, bool)

UUID uuid

Jump to

Keyboard shortcuts

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