util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const InternalCode = "86"

Variables

This section is empty.

Functions

func DecimalAdd

func DecimalAdd(d1 decimal.Decimal, d2 decimal.Decimal) decimal.Decimal

加法

func DecimalAddMore

func DecimalAddMore(ds ...decimal.Decimal) decimal.Decimal

连续加法

func DecimalDiv

func DecimalDiv(d1 decimal.Decimal, d2 decimal.Decimal) decimal.Decimal

除法

func DecimalDivMore

func DecimalDivMore(ds ...decimal.Decimal) decimal.Decimal

连续除法

func DecimalGreaterThan

func DecimalGreaterThan(d1 decimal.Decimal, d2 decimal.Decimal) bool

大于

func DecimalGreaterThanOrEqual

func DecimalGreaterThanOrEqual(d1 decimal.Decimal, d2 decimal.Decimal) bool

大于等于

func DecimalLessThan

func DecimalLessThan(d1 decimal.Decimal, d2 decimal.Decimal) bool

小于

func DecimalLessThanOrEqual

func DecimalLessThanOrEqual(d1 decimal.Decimal, d2 decimal.Decimal) bool

小于等于

func DecimalMul

func DecimalMul(d1 decimal.Decimal, d2 decimal.Decimal) decimal.Decimal

乘法

func DecimalMulMore

func DecimalMulMore(ds ...decimal.Decimal) decimal.Decimal

连续乘法

func DecimalSub

func DecimalSub(d1 decimal.Decimal, d2 decimal.Decimal) decimal.Decimal

减法

func DecimalSubMore

func DecimalSubMore(ds ...decimal.Decimal) decimal.Decimal

连续减法

func DecimalToFloat64

func DecimalToFloat64(d decimal.Decimal) float64

float

func DecimalToInt64

func DecimalToInt64(d decimal.Decimal) int64

int

func DecimalToString

func DecimalToString(d decimal.Decimal) string

func GenerateSecret

func GenerateSecret() string

生成秘钥

func GenerateSha1Sign

func GenerateSha1Sign(params, appSecret string) string

func GenerateSignCode

func GenerateSignCode(count uint8) string

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 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