Documentation ¶
Index ¶
- func Log(w io.Writer, msg string)
- func Now() int64
- type LazyScheduler
- func (ls *LazyScheduler) After(duration time.Duration, call *LazySchedulerCall)
- func (ls *LazyScheduler) Exec(call *LazySchedulerCall) (err error)
- func (ls *LazyScheduler) GenerateKey(timestamp int64) string
- func (ls *LazyScheduler) Recover()
- func (ls *LazyScheduler) Reg(fnName string, handler LazySchedulerHandler)
- type LazySchedulerCall
- type LazySchedulerHandler
- type MemDriver
- type MemDriverMemory
- func (md *MemDriverMemory) Exists(key string) bool
- func (md *MemDriverMemory) Expire(key string)
- func (md *MemDriverMemory) Inc(key string, expire time.Duration, overwriteTTLIfExists bool) int
- func (md *MemDriverMemory) IncBy(key string, value int, expire time.Duration, overwriteTTLIfExists bool) int
- func (md *MemDriverMemory) Init(kargs ...string)
- func (md *MemDriverMemory) List(key string) []string
- func (md *MemDriverMemory) Read(key string) (interface{}, bool)
- func (md *MemDriverMemory) SetExpire(key string, duration time.Duration) time.Duration
- func (md *MemDriverMemory) Wipe(prefix string)
- func (md *MemDriverMemory) WipePrefix(prefix string)
- func (md *MemDriverMemory) Write(key string, value interface{}, expire time.Duration, overwriteTTLIfExists bool) interface{}
- type MemDriverRedis
- func (md *MemDriverRedis) Exists(key string) bool
- func (md *MemDriverRedis) Expire(key string)
- func (md *MemDriverRedis) Inc(key string, expire time.Duration, overwriteTTLIfExists bool) int
- func (md *MemDriverRedis) IncBy(key string, value int, expire time.Duration, overwriteTTLIfExists bool) int
- func (md *MemDriverRedis) Init(kargs ...string)
- func (md *MemDriverRedis) List(prefix string) []string
- func (md *MemDriverRedis) Read(key string) (interface{}, bool)
- func (md *MemDriverRedis) SetExpire(key string, duration time.Duration) time.Duration
- func (md *MemDriverRedis) Wipe(prefix string)
- func (md *MemDriverRedis) WipePrefix(prefix string)
- func (md *MemDriverRedis) Write(key string, value interface{}, expire time.Duration, overwriteTTLIfExists bool) interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LazyScheduler ¶
type LazyScheduler struct {
// contains filtered or unexported fields
}
func NewLazyScheduler ¶
func NewLazyScheduler(driver MemDriver) *LazyScheduler
func (*LazyScheduler) After ¶
func (ls *LazyScheduler) After(duration time.Duration, call *LazySchedulerCall)
func (*LazyScheduler) Exec ¶
func (ls *LazyScheduler) Exec(call *LazySchedulerCall) (err error)
func (*LazyScheduler) GenerateKey ¶
func (ls *LazyScheduler) GenerateKey(timestamp int64) string
func (*LazyScheduler) Recover ¶
func (ls *LazyScheduler) Recover()
func (*LazyScheduler) Reg ¶
func (ls *LazyScheduler) Reg(fnName string, handler LazySchedulerHandler)
type LazySchedulerCall ¶
func LSC ¶
func LSC(fnName string, args interface{}) *LazySchedulerCall
func (*LazySchedulerCall) Arg ¶
func (lsc *LazySchedulerCall) Arg(to interface{})
type LazySchedulerHandler ¶
type LazySchedulerHandler = func(*LazySchedulerCall)
type MemDriver ¶
type MemDriver interface { Init(kargs ...string) Read(key string) (interface{}, bool) Write(key string, value interface{}, expire time.Duration, overwriteTTLIfExists bool) interface{} IncBy(key string, value int, expire time.Duration, overwriteTTLIfExists bool) int Inc(key string, expire time.Duration, overwriteTTLIfExists bool) int List(prefix string) []string Expire(key string) SetExpire(key string, duration time.Duration) time.Duration Exists(key string) bool Wipe(prefix string) WipePrefix(prefix string) }
type MemDriverMemory ¶
type MemDriverMemory struct { MemDriver // contains filtered or unexported fields }
func (*MemDriverMemory) Exists ¶
func (md *MemDriverMemory) Exists(key string) bool
func (*MemDriverMemory) Expire ¶
func (md *MemDriverMemory) Expire(key string)
func (*MemDriverMemory) Init ¶
func (md *MemDriverMemory) Init(kargs ...string)
func (*MemDriverMemory) List ¶
func (md *MemDriverMemory) List(key string) []string
func (*MemDriverMemory) Read ¶
func (md *MemDriverMemory) Read(key string) (interface{}, bool)
func (*MemDriverMemory) Wipe ¶ added in v1.9.2
func (md *MemDriverMemory) Wipe(prefix string)
func (*MemDriverMemory) WipePrefix ¶ added in v1.14.0
func (md *MemDriverMemory) WipePrefix(prefix string)
type MemDriverRedis ¶
type MemDriverRedis struct { MemDriver // contains filtered or unexported fields }
func (*MemDriverRedis) Exists ¶
func (md *MemDriverRedis) Exists(key string) bool
func (*MemDriverRedis) Expire ¶
func (md *MemDriverRedis) Expire(key string)
func (*MemDriverRedis) Init ¶
func (md *MemDriverRedis) Init(kargs ...string)
func (*MemDriverRedis) List ¶
func (md *MemDriverRedis) List(prefix string) []string
func (*MemDriverRedis) Read ¶
func (md *MemDriverRedis) Read(key string) (interface{}, bool)
func (*MemDriverRedis) Wipe ¶ added in v1.9.2
func (md *MemDriverRedis) Wipe(prefix string)
func (*MemDriverRedis) WipePrefix ¶ added in v1.14.0
func (md *MemDriverRedis) WipePrefix(prefix string)
Click to show internal directories.
Click to hide internal directories.