utils

package
v0.0.0-...-637fc73 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BKDRHash

func BKDRHash(str string) int

Auth:2021-03-30 15:39:27 周二 cole-cai Desc

func FormatValidateCodeContent

func FormatValidateCodeContent(code string, expire int64) string

Auth:2021/04/02 20:02:05 周五 cole-cai Desc:

func GenValidateCode

func GenValidateCode(width int) string

Auth:2021/04/01 23:57:16 周四 cole-cai Desc:生成验证码

func GetMessageName

func GetMessageName(m proto.Message) string

Auth:2021-03-30 15:43:01 周二 cole-cai Desc:获取message.fullname

func IsCurWeek

func IsCurWeek(tm int64) bool

Auth:2021-03-30 15:41:28 周二 cole-cai Desc:判断给定时间是否当前周

func IsSameDay

func IsSameDay(tm1, tm2 int64) bool

Auth:2021-03-30 15:40:08 周二 cole-cai Desc:判断连个时间戳是否同一天

func IsToday

func IsToday(tm int64) bool

Auth:2021-03-30 15:40:36 周二 cole-cai Desc:判断给定时间戳是否今天

func NewProtoMessage

func NewProtoMessage(name string) (proto.Message, error)

Auth:2021-03-30 15:42:32 周二 cole-cai Desc:根据message name 生成对应obj

func RetryTimes

func RetryTimes(name string, times int, duration time.Duration, fn func() error) error

Auth:2021/04/04 23:06:22 周日 cole-cai Desc:

func TodayDateStr

func TodayDateStr() string

Auth:2021-03-30 15:39:45 周二 cole-cai Desc: eg:20060102

func TodayLeftSecond

func TodayLeftSecond() int64

Auth:2021-03-30 15:42:01 周二 cole-cai Desc:获取当天剩余的秒数

func ValidateEmail

func ValidateEmail(email string) bool

Auth:2021/04/02 20:13:17 周五 cole-cai Desc:校验邮箱地址的合法性

func ValidatePhone

func ValidatePhone(phone string) bool

Auth:2021/04/02 20:39:04 周五 cole-cai Desc:校验手机号的合法性

Types

This section is empty.

Jump to

Keyboard shortcuts

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