Documentation ¶
Index ¶
- type LedisCacher
- func (c *LedisCacher) Decr(key string) error
- func (c *LedisCacher) Delete(key string) (err error)
- func (c *LedisCacher) Flush() error
- func (c *LedisCacher) Get(key string) interface{}
- func (c *LedisCacher) Incr(key string) error
- func (c *LedisCacher) IsExist(key string) bool
- func (c *LedisCacher) Put(key string, val interface{}, expire int64) (err error)
- func (c *LedisCacher) StartAndGC(opts cache.Options) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LedisCacher ¶
type LedisCacher struct {
// contains filtered or unexported fields
}
LedisCacher represents a ledis cache adapter implementation.
func (*LedisCacher) Decr ¶
func (c *LedisCacher) Decr(key string) error
Decr decreases cached int-type value by given key as a counter.
func (*LedisCacher) Delete ¶
func (c *LedisCacher) Delete(key string) (err error)
Delete deletes cached value by given key.
func (*LedisCacher) Get ¶
func (c *LedisCacher) Get(key string) interface{}
Get gets cached value by given key.
func (*LedisCacher) Incr ¶
func (c *LedisCacher) Incr(key string) error
Incr increases cached int-type value by given key as a counter.
func (*LedisCacher) IsExist ¶
func (c *LedisCacher) IsExist(key string) bool
IsExist returns true if cached value exists.
func (*LedisCacher) Put ¶
func (c *LedisCacher) Put(key string, val interface{}, expire int64) (err error)
Put puts value into cache with key and expire time. If expired is 0, it lives forever.
func (*LedisCacher) StartAndGC ¶
func (c *LedisCacher) StartAndGC(opts cache.Options) error
StartAndGC starts GC routine based on config string settings. AdapterConfig: data_dir=./app.db,db=0
Click to show internal directories.
Click to hide internal directories.