util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const InternalCode = "86"

Variables

This section is empty.

Functions

func GenInviterCode

func GenInviterCode() string

func GenerateSecret

func GenerateSecret() string

生成秘钥

func GenerateSha1Sign

func GenerateSha1Sign(params, appSecret string) string

func GenerateSignCode

func GenerateSignCode(count uint8) string

func GenerateToken

func GenerateToken(username string, uid int) (string, error)

func GetActivityBeginTime

func GetActivityBeginTime(beginTimeEv string) (int64, error)

func GetCompletePhone

func GetCompletePhone(countryCode, mobile string) string

func GetCurrentDay

func GetCurrentDay(d time.Time, hour, min int) time.Time

func GetCurrentDayStr

func GetCurrentDayStr(d time.Time) string

func GetCurrentTime

func GetCurrentTime() time.Time

func GetDayPoint

func GetDayPoint(bTime, eTime int64) (point []string)

获取时间段内的每天日期

func GetDayPoint2

func GetDayPoint2(st, et int64) (points []string)

func GetExpireTimeDay

func GetExpireTimeDay(expireUnixT, nowUnix int64) int32

func GetFirstDateOfMonth

func GetFirstDateOfMonth(d time.Time) time.Time

获取当月开始时间

func GetFirstDateOfWeek

func GetFirstDateOfWeek(d time.Time) time.Time

获取当周开始时间

func GetGrpcClient

func GetGrpcClient(serverName string) (*grpc.ClientConn, error)

func GetLastDateOfMonth

func GetLastDateOfMonth(d time.Time) time.Time

获取当月结束时间

func GetLastDateOfWeek

func GetLastDateOfWeek(d time.Time) time.Time

获取当周结束时间

func GetMSTimeStamp

func GetMSTimeStamp() int64

func GetMonthPoint

func GetMonthPoint(bTime, eTime int64) (point []string)

获取时间段内的每月日期

func GetMonthPoint2

func GetMonthPoint2(st, et int64) (points []string)

func GetNDayPoint

func GetNDayPoint(n int, eTime int64) (startT, endT int64, m map[string]StartAndStopTime)

获取7天日期

func GetNMonthPoint

func GetNMonthPoint(n int, eTime int64) (startT, endT int64, m map[string]StartAndStopTime)

获取7月日期

func GetNWeekPoint

func GetNWeekPoint(n int, eTime int64) (startT, endT int64, m map[string]StartAndStopTime)

获取7周日期

func GetSecTimeStamp

func GetSecTimeStamp() int64

func GetTimeStamp

func GetTimeStamp() int64

func GetUUID

func GetUUID() string

func GetWeekPoint

func GetWeekPoint(bTime, eTime int64) (point []string)

获取时间段内的每周日期

func GetWeekPoint2

func GetWeekPoint2(st, et int64) (points []string)

func GetZeroTimeOfDay

func GetZeroTimeOfDay(d time.Time) time.Time

获取当天的0点时间

func ParseTimeOfCustom

func ParseTimeOfCustom(unixT int64, layStr string) string

func ParseTimeOfStr

func ParseTimeOfStr(unixT int64) string

func RemoveDuplicateElement

func RemoveDuplicateElement(src []string) []string

func SeparateTable

func SeparateTable(id string, count int) string

分表

func Time2MSTimeStamp

func Time2MSTimeStamp(t *time.Time) int64

Types

type Claims

type Claims struct {
	UserName string `json:"user_name"`
	Uid      int    `json:"uid"`
	jwt.StandardClaims
}

func ParseToken

func ParseToken(token string) (*Claims, error)

type CustomTime

type CustomTime struct {
	time.Time
}

func (*CustomTime) IsSet

func (ct *CustomTime) IsSet() bool

func (*CustomTime) MarshalJSON

func (ct *CustomTime) MarshalJSON() ([]byte, error)

func (*CustomTime) UnmarshalJSON

func (ct *CustomTime) UnmarshalJSON(b []byte) (err error)

type StartAndStopTime

type StartAndStopTime struct {
	StartTime int64
	StopTime  int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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