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