identifier

package
v1.20.3 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Email  = "email"  //邮箱
	Mobile = "mobile" //手机
	Device = "device" //设备

)

Variables

View Source
var (
	ErrInvalidEmail       = errors.New("invalid email address")
	ErrEmailDomainDenied  = errors.New("email domain is not allowed")
	ErrEmailDomainListNil = errors.New("email domain allowlist is empty")
)

Functions

func CanonicalEmail

func CanonicalEmail(email string) string

func CanonicalIdentifier

func CanonicalIdentifier(authType, identifier string) string

func Check

func Check(areaCode, telephone string) bool

func CheckPhone

func CheckPhone(telephone string) bool

func FormatToE164

func FormatToE164(area, phone string) (string, error)

func FormatToInternational

func FormatToInternational(telephone string) string

func GetCountryCode

func GetCountryCode(telephone string) string

func MaskEmail

func MaskEmail(email string) string

func MaskPhoneNumber

func MaskPhoneNumber(phone string) string

MaskPhoneNumber 解析并脱敏电话号码

func ValidateEmail

func ValidateEmail(email, domainList string, enforceDomain bool) (string, error)

ValidateEmail canonicalizes and validates an email address. When domain filtering is enabled, the address domain must match an allowlisted domain or one of its subdomains at a label boundary.

Types

This section is empty.

Jump to

Keyboard shortcuts

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