goverify

package module
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 1 Imported by: 0

README

Golang Verify

📦 Golang 验证

godoc goproxy.cn goreportcard.com deps.dev

安装

go get -v -u go.dtapp.net/goverify@v1.0.8

使用

package main

import (
	"go.dtapp.net/goverify"
	"testing"
)

// TestChinaMobile 验证手机号码
func TestChinaMobile(t *testing.T) {
	t.Log(goverify.ChinaMobile("13800138000"))
}

// TestChinaMobileNumber 验证中国移动手机号码
func TestChinaMobileNumber(t *testing.T) {
	t.Log(goverify.ChinaMobileNumber("13800138000"))
}

// TestChinaUnicomNumber 验证中国联通手机号码
func TestChinaUnicomNumber(t *testing.T) {
	t.Log(goverify.ChinaUnicomNumber("13800138000"))
}

// TestChinaTelecomNumber 验证中国电信手机号码
func TestChinaTelecomNumber(t *testing.T) {
	t.Log(goverify.ChinaTelecomNumber("13800138000"))
}

// TestChinaBroadnetNumber 验证中国广电手机号码
func TestChinaBroadnetNumber(t *testing.T) {
	t.Log(goverify.ChinaBroadnetNumber("13800138000"))
}

// TestChinaVirtualNumber 验证虚拟运营商手机号码
func TestChinaVirtualNumber(t *testing.T) {
	t.Log(goverify.ChinaVirtualNumber("13800138000"))
}

Documentation

Index

Constants

View Source
const (
	Mobile   = "mobile"   // 中国移动
	Unicom   = "unicom"   // 中国联通
	Telecom  = "telecom"  // 中国电信
	Broadnet = "broadnet" // 中国广电
	Virtual  = "virtual"  // 虚拟
)
View Source
const Version = "1.0.8"

Variables

This section is empty.

Functions

func ChinaBroadnetNumber added in v1.0.5

func ChinaBroadnetNumber(number string) bool

ChinaBroadnetNumber 验证中国广电手机号码 https://www.qqzeng.com/tongji.html 广电:192

func ChinaMobileNumber

func ChinaMobileNumber(number string) bool

ChinaMobileNumber 验证中国移动手机号码 https://www.qqzeng.com/tongji.html 移动:134 135 136 137 138 139 147 148 150 151 152 157 158 159 172 178 182 183 184 187 188 195 197 198

func ChinaTelecomNumber

func ChinaTelecomNumber(number string) bool

ChinaTelecomNumber 验证中国电信手机号码 https://www.qqzeng.com/tongji.html 电信:133 149 153 173 174 177 180 181 189 190 191 193 199

func ChinaUnicomNumber

func ChinaUnicomNumber(number string) bool

ChinaUnicomNumber 验证中国联通手机号码 https://www.qqzeng.com/tongji.html 联通:130 131 132 145 146 155 156 166 167 171 175 176 185 186 196

func ChinaVirtualNumber

func ChinaVirtualNumber(number string) bool

ChinaVirtualNumber 验证虚拟运营商手机号码 https://www.qqzeng.com/tongji.html 移动/联通/电信: 162 165 167 170 171

func Email

func Email(email string) bool

Email 验证邮箱号码

func GetType added in v1.0.7

func GetType(name string) (Type string)

GetType 获取运营商类型

func GetTypeName added in v1.0.6

func GetTypeName(Type string) string

GetTypeName 获取运营商类型名称

func IdCard

func IdCard(idCard string) bool

IdCard 验证身份证号码

Types

This section is empty.

Jump to

Keyboard shortcuts

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