xvalidate

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Between

func Between(s string, min, max int) bool

Between 检测字符串长度是否在设置的范围之间

func In

func In(v interface{}, set interface{}) bool

In 检测是值是否在给定的集合中

func IsAccount

func IsAccount(account string, min int, max int) bool

IsAccount 检测是否是账号

func IsDigit

func IsDigit(digit string) bool

IsDigit 检测是否是数值(正负整数、正负浮点数)

func IsEmail

func IsEmail(email string) bool

IsEmail 检测是否是邮箱

func IsIdCard added in v2.1.0

func IsIdCard(idCard string) bool

IsIdCard 检测是否是身份证号(国内18位) 感谢知乎网友提供:https://zhuanlan.zhihu.com/p/608188853

func IsMobile

func IsMobile(mobile string) bool

IsMobile 检测是否是手机号(国内)

func IsNumber

func IsNumber(number string, langths ...int) bool

IsNumber 检测是否是数字

func IsQQ

func IsQQ(qq string) bool

IsQQ 是否是QQ号

func IsTelephone

func IsTelephone(telephone string) bool

IsTelephone 检测是否是电话号码

func IsUrl

func IsUrl(url string) bool

IsUrl 检测是否是URL

func Length

func Length(s string, n int) bool

Length 检测字符串长度是否等于固定长度

func MaxLength

func MaxLength(s string, n int) bool

MaxLength 检测字符串的最大长度

func MinLength

func MinLength(s string, n int) bool

MinLength 检测字符串的最小长度

Types

This section is empty.

Jump to

Keyboard shortcuts

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