Documentation ¶
Index ¶
- func AsClient(client interface{}) *memcache.Client
- func New() cache.Cache
- func NewItem(key string, data []byte, expire int32) *memcache.Item
- type MemcacheCacher
- func (c *MemcacheCacher) Client() interface{}
- func (c *MemcacheCacher) Close() error
- func (c *MemcacheCacher) Codec() encoding.Codec
- func (c *MemcacheCacher) Decr(ctx context.Context, key string) error
- func (c *MemcacheCacher) Delete(ctx context.Context, key string) error
- func (c *MemcacheCacher) Flush(ctx context.Context) error
- func (c *MemcacheCacher) Get(ctx context.Context, key string, value interface{}) error
- func (c *MemcacheCacher) Incr(ctx context.Context, key string) error
- func (c *MemcacheCacher) IsExist(ctx context.Context, key string) (bool, error)
- func (c *MemcacheCacher) Put(ctx context.Context, key string, val interface{}, expire int64) error
- func (c *MemcacheCacher) SetCodec(codec encoding.Codec)
- func (c *MemcacheCacher) StartAndGC(ctx context.Context, opt cache.Options) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MemcacheCacher ¶
MemcacheCacher represents a memcache cache adapter implementation.
func (*MemcacheCacher) Client ¶
func (c *MemcacheCacher) Client() interface{}
func (*MemcacheCacher) Close ¶
func (c *MemcacheCacher) Close() error
func (*MemcacheCacher) Codec ¶
func (c *MemcacheCacher) Codec() encoding.Codec
func (*MemcacheCacher) Decr ¶
func (c *MemcacheCacher) Decr(ctx context.Context, key string) error
Decr decreases cached int-type value by given key as a counter.
func (*MemcacheCacher) Delete ¶
func (c *MemcacheCacher) Delete(ctx context.Context, key string) error
Delete deletes cached value by given key.
func (*MemcacheCacher) Flush ¶
func (c *MemcacheCacher) Flush(ctx context.Context) error
Flush deletes all cached data.
func (*MemcacheCacher) Get ¶
func (c *MemcacheCacher) Get(ctx context.Context, key string, value interface{}) error
Get gets cached value by given key.
func (*MemcacheCacher) Incr ¶
func (c *MemcacheCacher) Incr(ctx context.Context, key string) error
Incr increases cached int-type value by given key as a counter.
func (*MemcacheCacher) Put ¶
Put puts value into cache with key and expire time. If expired is 0, it lives forever.
func (*MemcacheCacher) SetCodec ¶
func (c *MemcacheCacher) SetCodec(codec encoding.Codec)
func (*MemcacheCacher) StartAndGC ¶
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.