memcache

package
v0.0.0-...-5117fa9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2018 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemCache

func NewMemCache() cache.Cache

NewMemCache create new memcache adapter.

func NewMemcacheClient

func NewMemcacheClient(config map[string]interface{}) (*memcache.Client, error)

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache Memcache adapter.

func (*Cache) Decr

func (t *Cache) Decr(key string) error

Decr decrease counter,memcache dono't support decrement negative number

func (*Cache) Delete

func (t *Cache) Delete(key string) error

Delete delete value in memcache.

func (*Cache) FlushAll

func (t *Cache) FlushAll() error

ClearAll clear all cached in memcache.

func (*Cache) Get

func (t *Cache) Get(key string, dest interface{}) error

Get get value from memcache.

func (*Cache) GetMulti

func (t *Cache) GetMulti(keys []string) []interface{}

GetMulti get value from memcache.

func (*Cache) Incr

func (t *Cache) Incr(key string) error

Incr increase counter.

func (*Cache) IsExist

func (t *Cache) IsExist(key string) bool

IsExist check value exists in memcache.

func (*Cache) NewCacheItem

func (t *Cache) NewCacheItem(key string, val interface{}, timeout time.Duration) (*memcache.Item, error)

func (*Cache) Set

func (t *Cache) Set(key string, val interface{}, timeout time.Duration) error

Set put value to memcache.

func (*Cache) StartAndGC

func (t *Cache) StartAndGC(config map[string]interface{}) error

StartAndGC start memcache adapter. config string is like {"conn":"connection info"}. if connecting error, return.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL