Documentation ¶
Index ¶
- Variables
- func GetDayTime(t time.Time, addDays int) time.Time
- func GetSignFromStamp(s int64) int32
- func GetSignFromTime(t time.Time) int32
- func GetTimeFromSign(sign int32) time.Time
- func GetWeekTime(t time.Time, addWeeks int) time.Time
- func IndexOf(arr []int, tar int) int
- func MaxNumber(l int) uint64
- func NewCrypto(encoding *base64.Encoding) *crypto
- func NewRandom(randomStringSeed string) *random
- func ObjectID(s ...string) (bson.ObjectId, error)
- func PKCSSPadding(data []byte, blockSize int) []byte
- func PKCSSUnPadding(data []byte) []byte
- func Timeout(d time.Duration, fn func() error) error
- func Try(f func(), handler ...func(interface{}))
- type ArrayMap
- func (r *ArrayMap) Add(value interface{}) int32
- func (r *ArrayMap) Clone() *ArrayMap
- func (r *ArrayMap) Del(key int32)
- func (r *ArrayMap) Get(key int32) interface{}
- func (r *ArrayMap) RawGet(key int32) interface{}
- func (r *ArrayMap) RawLen() int32
- func (r *ArrayMap) Set(key int32, value interface{})
- type Bitwise
- type CryptoType
- type Job
- type SCC
- type TaskData
- type TimeWheel
- func (tw *TimeWheel) AddTask(interval time.Duration, times int, key interface{}, data TaskData, job Job) error
- func (tw *TimeWheel) RemoveTask(key interface{}) error
- func (tw *TimeWheel) Start()
- func (tw *TimeWheel) Stop()
- func (tw *TimeWheel) UpdateTask(key interface{}, interval time.Duration, taskData TaskData) error
- type Worker
Constants ¶
This section is empty.
Variables ¶
View Source
var Crypto *crypto
View Source
var ErrorTimeout = errors.New("timeout")
View Source
var EventWriteChanSize = 5000
View Source
var Random *random
View Source
var WeekStartDay = 1
每周开始时间 1:周一,0:周日
View Source
var WorkerWriteChanSize = 5000
Functions ¶
func GetDayTime ¶
获取一天的开始时间 addDays:天偏移,0:今天凌晨,1:明天凌晨
func GetSignFromTime ¶
func GetTimeFromSign ¶
func GetWeekTime ¶
获取本周开始时间 addWeeks:周偏移,0:本周,1:下周 -1:上周
Types ¶
type ArrayMap ¶
type ArrayMap struct {
// contains filtered or unexported fields
}
func NewArrayMap ¶
type CryptoType ¶
type CryptoType int
const ( CryptoTypeDES CryptoType = iota //秘钥长度8字节 也就是64位 CryptoTypeAES //秘钥长度位16 24 32 字节 也就是128 192 256位。 CryptoType3DES )
type TimeWheel ¶
type TimeWheel struct {
// contains filtered or unexported fields
}
time wheel struct
func (*TimeWheel) AddTask ¶
func (tw *TimeWheel) AddTask(interval time.Duration, times int, key interface{}, data TaskData, job Job) error
AddTask add new task to the time wheel
func (*TimeWheel) RemoveTask ¶
RemoveTask remove the task from time wheel
Click to show internal directories.
Click to hide internal directories.