Versions in this module Expand all Collapse all v1 v1.0.0 Aug 5, 2022 Changes in this version + var Epoch int64 = 1288834974657 + var ErrInvalidBase32 = errors.New("invalid base32") + var ErrInvalidBase58 = errors.New("invalid base58") + var NodeBits uint8 = 10 + var StepBits uint8 = 12 + func GetLoaclIp() string + func Ipv4StringToInt(ip string) int64 + type Cache struct + func New() (*Cache, error) + func (c Cache) BindDeleteCallBackFunc(f func(string, interface{})) + func (c Cache) Del(k string) + func (c Cache) Exists(k string) bool + func (c Cache) Get(k string) (interface{}, bool) + func (c Cache) GetEx(k string) (interface{}, time.Time, bool) + func (c Cache) HDel(key string, fields ...string) + func (c Cache) HExists(key string, fields ...string) bool + func (c Cache) HGet(key string, fields ...string) map[string]interface{} + func (c Cache) HGetAll(key string) map[string]interface{} + func (c Cache) HKeys(key string) []string + func (c Cache) HMSet(key string, data map[string]interface{}) + func (c Cache) HSet(key, field string, val interface{}) + func (c Cache) HSetEx(key string, d time.Duration, callBack bool) bool + func (c Cache) HSetNx(key, field string, val interface{}) bool + func (c Cache) HVAls(key string) []interface{} + func (c Cache) ItemCount() int + func (c Cache) Items() map[string]interface{} + func (c Cache) SAdd(key string, d time.Duration, callBack bool, members ...interface{}) + func (c Cache) SCard(key string) int + func (c Cache) SISMembers(key string, member interface{}) bool + func (c Cache) SMembers(key string) []interface{} + func (c Cache) SRem(key string, members ...interface{}) int + func (c Cache) Set(k string, v interface{}, d time.Duration, callBack bool) + func (c Cache) SetNx(k string, v interface{}, d time.Duration, callBack bool) bool + func (c Cache) Stop() + type HASHItem struct + CallBack bool + Expiration int64 + Key string + Object map[string]interface{} + type ID int64 + func ParseBase2(id string) (ID, error) + func ParseBase32(b []byte) (ID, error) + func ParseBase36(id string) (ID, error) + func ParseBase58(b []byte) (ID, error) + func ParseBase64(id string) (ID, error) + func ParseBytes(id []byte) (ID, error) + func ParseInt64(id int64) ID + func ParseIntBytes(id [8]byte) ID + func ParseString(id string) (ID, error) + func (f *ID) UnmarshalJSON(b []byte) error + func (f ID) Base2() string + func (f ID) Base32() string + func (f ID) Base36() string + func (f ID) Base58() string + func (f ID) Base64() string + func (f ID) Bytes() []byte + func (f ID) Int64() int64 + func (f ID) IntBytes() [8]byte + func (f ID) MarshalJSON() ([]byte, error) + func (f ID) Node() int64 + func (f ID) Step() int64 + func (f ID) String() string + func (f ID) Time() int64 + type JSONSyntaxError struct + func (j JSONSyntaxError) Error() string + type Job func(interface{}) + type KVItem struct + CallBack bool + Expiration int64 + Key string + Object interface{} + type Node struct + func NewNode(node int64) (*Node, error) + func (n *Node) Generate() ID + type Set struct + CallBack bool + Expiration int64 + Key string + Member interface{} + type SetItem struct + Object map[interface{}]Set + type Task struct + type TimeWheel struct + C chan interface{} + func NewTw(interval time.Duration, slotNum int, job Job) *TimeWheel + func (tw *TimeWheel) AddTimer(delay time.Duration, key interface{}, data interface{}) + func (tw *TimeWheel) RemoveTimer(key interface{}) + func (tw *TimeWheel) Start() + func (tw *TimeWheel) Stop()