tool

package
v0.0.0-...-50e54af Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmountDiv1e12UInt64

func AmountDiv1e12UInt64(amount string, str string) (uint64, bool)

func AmountMul1e12

func AmountMul1e12(amount string, str string) (string, bool)

func ClickLoginPwdStr

func ClickLoginPwdStr(ss string, str string) bool

ClickLoginPwdStr 校验密码 ss 用户输入密码 str 数据库用户密码

func FixThPhone

func FixThPhone(phone string) string

func GetClientIP

func GetClientIP(req *http.Request) string

func GetEndDaySecond

func GetEndDaySecond() int64

GetEndDaySecond 获取到今天还剩下多少秒

func GetLoginPwdStr

func GetLoginPwdStr(str string) string

func GetMD5Encode

func GetMD5Encode(data string) string

返回一个32位md5加密后的字符串

func GetRandomRedisTimeOut

func GetRandomRedisTimeOut(base time.Duration) time.Duration

GetRandomRedisTimeOut 在指定时间上添加一个300秒的随机值

func GetSha1Str

func GetSha1Str(str string) string

func GetTimeUnix

func GetTimeUnix() int64

GetTimeUnix 获取秒级时间戳

func GetTimeUnixBefore

func GetTimeUnixBefore(duration time.Duration) int64

GetTimeUnixBefore 获取多少时间以前的时间戳

func GetTimeUnixMilli

func GetTimeUnixMilli() int64

GetTimeUnixMilli 获取毫秒级时间戳

func GetVIPLevel

func GetVIPLevel(VIP string) (bool, int)

func GetVIPUpdate

func GetVIPUpdate(VIP string) (bool, int)

func Int64ToStr

func Int64ToStr(num int64) string

func Int64ToString

func Int64ToString(num int64) string

func IntInSlice

func IntInSlice(num int, slice []int) (exists bool)

func IntToStr

func IntToStr(num int) string

func IsThPhone

func IsThPhone(phone string) bool

func Print

func Print(str string, data ...interface{})

func QuitSignal

func QuitSignal(quitFunc func())

func RandInt64

func RandInt64(min, max int64) int64

func RandStringRunes

func RandStringRunes(n int) string

func RemoveRep

func RemoveRep(slc []int) []int

元素去重

func RemoveRepByLoop

func RemoveRepByLoop(slc []int) []int

通过两重循环过滤重复元素

func RemoveRepByMap

func RemoveRepByMap(slc []int) []int

通过map主键唯一的特性过滤重复元素

func TimeToYYYYMMDDStr

func TimeToYYYYMMDDStr(t int64) string

TimeToYYYYMMDDStr 格式化时间 t 毫秒时间戳 1620102515929 -> 2021-05-04

func To2Decimal

func To2Decimal(value float64) float64

取2位精度并转换成int64

func Uint32ToString

func Uint32ToString(num uint32) string

func Uint64ToString

func Uint64ToString(num uint64) string

Types

type DS

type DS struct {
	Ds string
	T  time.Time
}

func GetBetweenDates

func GetBetweenDates(sdate, edate string) []DS

GetBetweenDates 根据开始日期和结束日期计算出时间段内所有日期 参数为日期格式,如:2020-01-01

type Switch

type Switch int16

func (Switch) CheckTurnOn

func (s Switch) CheckTurnOn(index int) (result bool)

func (*Switch) TurnOff

func (s *Switch) TurnOff(index int)

func (*Switch) TurnOn

func (s *Switch) TurnOn(index int)

Jump to

Keyboard shortcuts

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