common

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Date = "2006-01-02"
View Source
const DateTime = "2006-01-02 15:04:05"
View Source
const MobileJoiner = ":"
View Source
const WechatUnionPrefix = "wechat:"

Variables

This section is empty.

Functions

func Context

func Context(dur ...time.Duration) (context.Context, context.CancelFunc)

func ConvertFromLowerShortUrl

func ConvertFromLowerShortUrl(str string) int64

func ConvertFromShortUrl

func ConvertFromShortUrl(str string) int64

func ConvertToLowerShortUrl

func ConvertToLowerShortUrl(id int64) string

转换url

func ConvertToShortUrl

func ConvertToShortUrl(id int64) string

转换url

func GenerateNumber

func GenerateNumber(min, max int) int

func GenerateString

func GenerateString(length int) string

func GenerateUUID

func GenerateUUID() string

func GenerateUniqueString

func GenerateUniqueString(length int) string

func Hmac

func Hmac(str, key string) string

func Load

func Load()

func MaskEmail

func MaskEmail(email string) string

func MaskMobile

func MaskMobile(mobile string) string

func MaskString

func MaskString(input string) string

func Md5

func Md5(str string) string

func MustString

func MustString(input *string) string

func Pinyin

func Pinyin(input string) []string

func PureMobile

func PureMobile(mobile string) string

func ResolveRegexString

func ResolveRegexString(text string) string

func Reverse

func Reverse(s string) (result string)

func Segment

func Segment(keywords string) []string

func Sha1

func Sha1(str string) string

func ShaPass

func ShaPass(pass string) string

func ValidateEmail

func ValidateEmail(e string) bool

验证Email,必须是字母数字组合 6-20位

func ValidateMobile

func ValidateMobile(e string) bool

验证是否是手机号码

func ValidateName

func ValidateName(name string) bool

验证用户名,必须是字母数字组合 3-20位

func ValidatePassword

func ValidatePassword(password string) bool

验证密码

Types

type Type

type Type string
const (
	TypeEmail  Type = "EMAIL"
	TypeMobile Type = "MOBILE"
	TypeUnknow Type = "UNKNOW"
)

func IdentityType

func IdentityType(e string) Type

Jump to

Keyboard shortcuts

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