validator

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidIP = iota
	IPv4
	IPv6
)

Variables

This section is empty.

Functions

func IsChineseIDCard

func IsChineseIDCard(idCard string) bool

IsChineseIDCard 检查字符串是否为有效的中国大陆身份证号码(支持15位和18位)

func IsEmail

func IsEmail(email string) bool

IsEmail 检查字符串是否为有效的电子邮件地址

func IsIP

func IsIP(ip string) (bool, int)

IsIP 检查字符串是否为有效的 IP 地址,并返回 IP 类型

func IsMobile

func IsMobile(mobile string) bool

IsMobile 检查字符串是否为有效的手机号

func IsPort

func IsPort(portStr string) bool

IsPort 检查字符串是否为有效的端口

func IsURL

func IsURL(urlStr string) bool

IsURL 检查字符串是否为有效的 URL

Types

This section is empty.

Jump to

Keyboard shortcuts

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