Documentation
¶
Index ¶
- Variables
- func CreateDecimalByTimeStamp(timeStamp int64) float64
- func DateToTm(date string) int64
- func DateYMHSIsBetween(start, end string) bool
- func DateYMHSIsBetweenTime(t time.Time, start, end string) bool
- func GenerateDrawRandNum(min, max, sum int) ([]int32, error)
- func GetFirstDateOfWeek(now time.Time) (weekMonday time.Time)
- func GetTimeWithHourAnchor(anchorHour int32, days int32) time.Time
- func MakeCtxFromConnection(conn ziface.IConnection) context.Context
- func NowDateYMHSIsBetween(start, end string) bool
- func NowDateYMHSIsBetweenTime(t time.Time, start, end string) bool
- func NowMonthStartEndTime() (startTime, endTime time.Time)
- func NowMonthStartEndTimeUnix() (startTime, endTime int64)
- func TimestampDurationDay(start, end int64) int32
- func TimestampDurationDayWithAnchor(start, end int64, anchorHour int32) int32
- func Unwrap(num int64, retain int) float64
- func UnwrapToInt64(num int64, retain int) int64
- func Wrap(num float64, retain int) int64
- func WrapToFloat64(num float64, retain int) float64
- type FileTools
- type IDPool
- type InterfaceTools
- type SliceTools
- func (receiver *SliceTools) ColumnBySlice(mapParams []map[string]interface{}, keyParams string) []interface{}
- func (h SliceTools) DeleteEmptyAndUnique(arr []string) []string
- func (h SliceTools) Difference(slice1, slice2 []string) []string
- func (h SliceTools) DifferenceSliceByString(sliceOne []string, sliceTwo []string) []string
- func (h SliceTools) GetAddAndDelete(old []int64, new []int64) ([]int64, []int64)
- func (receiver *SliceTools) GetIntersection(sliceParams1 []string, sliceParams2 []string) []string
- func (SliceTools) InArray(obj interface{}, target interface{}) bool
- func (receiver *SliceTools) InSliceString(keyParams string, sliceParams []string) bool
- func (h SliceTools) InsertionSort(arr []int64)
- func (h SliceTools) RemoveDuplicateElement(languages []string) []string
- func (h SliceTools) RemoveDuplicateElementLongInt(languages []int64) []int64
- func (h SliceTools) SliceIntAsc(arr []int) []int
- func (h SliceTools) SliceIntDesc(arr []int) []int
- func (h SliceTools) ToSliceStringByInt(params []int) []string
- func (receiver SliceTools) ToSliceStringByInterface(params []interface{}) []string
- type VarTools
Constants ¶
This section is empty.
Variables ¶
var ( ErrNull = errors.New("errNull") ErrTokenInvalid = errors.New("ErrTokenInvalid") ErrDecodeToken = errors.New("ErrDecodeToken") ErrUnmarshalToken = errors.New("ErrUnmarshalToken") )
var GlobalDataMapChannel = make(map[int32]*cfg2.DataChannel, 0)
var GlobalDataMapInitInitialClothing = make(map[int32]*cfg2.DataInitialClothing, 0)
var GlobalDataMapInitInitialProps = make(map[int32]*cfg2.DataInitialProps, 0)
var GlobalDataMapItemRule = make(map[string]*cfg2.DataItemRule, 0)
var GlobalDataMapScene = make(map[int32]*cfg2.DataScene, 0)
var GlobalRandNameSlice = make([]string, 0)
Functions ¶
func CreateDecimalByTimeStamp ¶
根据时间戳返回一个小于1的小数,时间越早值越大(2的14次方/现在距离1970的天数(精确到秒))
func DateYMHSIsBetween ¶
func GenerateDrawRandNum ¶
GenerateDrawRandNum 区间:前闭后开 不能从0开始 会重复
func GetTimeWithHourAnchor ¶
GetTimeWithHourAnchor 计算当前时间指定天数的指定时间 anchor (int): 锚点小时,格式为 5 days (int): 指定天数 return: 指定时间
func MakeCtxFromConnection ¶
func MakeCtxFromConnection(conn ziface.IConnection) context.Context
func NowDateYMHSIsBetween ¶
func NowMonthStartEndTimeUnix ¶
func NowMonthStartEndTimeUnix() (startTime, endTime int64)
获取本月开始结束时间时分秒 2024-07-01 00:00:00 - 2024-07-31 23:59:59
func TimestampDurationDay ¶
TimestampDurationDay 计算从start时间开始到end时间结束经过的天数(过24:00:00算一天)
func TimestampDurationDayWithAnchor ¶
TimestampDurationDayWithAnchor 计算从start时间开始到end时间结束经过的天数 start: 开始时间戳 end: 结束时间戳 anchor (int): 锚点小时,格式为 5(凌晨5点为一天) 或 6(凌晨6点为一天) return: 经过的天数
Types ¶
type InterfaceTools ¶
type InterfaceTools struct {
}
* * InterfaceTools * @Description:
var InterfaceToolsObject InterfaceTools
* * InterfaceTools * @Description:
func (*InterfaceTools) IsNumber ¶
func (i *InterfaceTools) IsNumber(value interface{}) bool
*
- isNumber
- @Description: 是否是数字类型的数据
- @receiver i
- @param value
- @return bool
func (*InterfaceTools) ToString ¶
func (i *InterfaceTools) ToString(value interface{}) string
/** * Strval * @Description: Strval 获取变量的字符串值,浮点型 3.0将会转换成字符串3, "3",非数值或字符类型的变量将会被转换成JSON格式字符串 * @param value * @return string */
type SliceTools ¶
type SliceTools struct {
}
SliceTools /**
var SliceToolsObject SliceTools
SliceToolsObject /**
func (*SliceTools) ColumnBySlice ¶
func (receiver *SliceTools) ColumnBySlice(mapParams []map[string]interface{}, keyParams string) []interface{}
func (SliceTools) DeleteEmptyAndUnique ¶
func (h SliceTools) DeleteEmptyAndUnique(arr []string) []string
func (SliceTools) Difference ¶
func (h SliceTools) Difference(slice1, slice2 []string) []string
func (SliceTools) DifferenceSliceByString ¶
func (h SliceTools) DifferenceSliceByString(sliceOne []string, sliceTwo []string) []string
func (SliceTools) GetAddAndDelete ¶
func (h SliceTools) GetAddAndDelete(old []int64, new []int64) ([]int64, []int64)
func (*SliceTools) GetIntersection ¶
func (receiver *SliceTools) GetIntersection(sliceParams1 []string, sliceParams2 []string) []string
func (SliceTools) InArray ¶
func (SliceTools) InArray(obj interface{}, target interface{}) bool
InArray 查找字符是否在数组中
func (*SliceTools) InSliceString ¶
func (receiver *SliceTools) InSliceString(keyParams string, sliceParams []string) bool
func (SliceTools) InsertionSort ¶
func (h SliceTools) InsertionSort(arr []int64)
func (SliceTools) RemoveDuplicateElement ¶
func (h SliceTools) RemoveDuplicateElement(languages []string) []string
func (SliceTools) RemoveDuplicateElementLongInt ¶
func (h SliceTools) RemoveDuplicateElementLongInt(languages []int64) []int64
func (SliceTools) ToSliceStringByInt ¶
func (h SliceTools) ToSliceStringByInt(params []int) []string
func (SliceTools) ToSliceStringByInterface ¶
func (receiver SliceTools) ToSliceStringByInterface(params []interface{}) []string
type VarTools ¶
type VarTools struct {
}
var VarToolsObject VarTools
func (VarTools) InitInitialClothing ¶ added in v0.0.57
func (v VarTools) InitInitialClothing()
func (VarTools) InitInitialProps ¶ added in v0.0.57
func (v VarTools) InitInitialProps()
func (VarTools) InitRandName ¶ added in v0.0.14
func (v VarTools) InitRandName()