util

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//GlobalTimer timer queue
	GlobalTimer = timerqueue.New()
)

Functions

func ExplodeInt64

func ExplodeInt64(str string, seperator string) (result []int64)

ExplodeInt64 explode string to slice

func ExplodeUint32

func ExplodeUint32(str string, seperator string) (result []uint32)

ExplodeUint32 explode string to slice

func GetContextValueInt64

func GetContextValueInt64(c *blademaster.Context, key string) (v int64, ok bool)

GetContextValueInt64 get context int64

func GetContextValueString

func GetContextValueString(c *blademaster.Context, key string) (v string, ok bool)

GetContextValueString get context string

func GetNextPeriodTime

func GetNextPeriodTime(clock string, period time.Duration, currentTime time.Time) (next time.Time, err error)

GetNextPeriodTime get next period time from current time clock, like "03:05:00" period, like 24h currentTime, like now return the next alarm time for this clock

func IsBitSet

func IsBitSet(attr int, bit uint) bool

IsBitSet bit is from 0 to 31

func IsBitSet64

func IsBitSet64(attr int64, bit uint) bool

IsBitSet64 bit is from 0 to 63

func ParseCommonTime

func ParseCommonTime(layout string, value string) (t xtime.Time, err error)

ParseCommonTime parse to library common time

func SetBit64

func SetBit64(attr int64, bit uint) int64

SetBit64 set bit to 1

func TruncateDate

func TruncateDate(tm time.Time) time.Time

TruncateDate 截取到整天,舍去时分秒

func UnSetBit64

func UnSetBit64(attr int64, bit uint) int64

UnSetBit64 set bit to 0

func Unique

func Unique(intSlice []int64) []int64

Unique unique the slice

Types

This section is empty.

Directories

Path Synopsis
Package now is a time toolkit for golang.
Package now is a time toolkit for golang.
Package timerqueue implements a priority queue for objects scheduled at a particular time.
Package timerqueue implements a priority queue for objects scheduled at a particular time.

Jump to

Keyboard shortcuts

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