v1.6.0 Latest Latest

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

Go to latest
Published: Jan 17, 2016 License: Apache-2.0 Imports: 6 Imported by: 0



Package memcache for cache provider

depend on

go install

Usage: import(

_ ""


bm, err := cache.NewCache("memcache", `{"conn":""}`)

more docs



This section is empty.


This section is empty.


func NewMemCache

func NewMemCache() cache.Cache

NewMemCache create new memcache adapter.


type Cache added in v1.6.0

type Cache struct {
	// contains filtered or unexported fields

Cache Memcache adapter.

func (*Cache) ClearAll added in v1.6.0

func (rc *Cache) ClearAll() error

ClearAll clear all cached in memcache.

func (*Cache) Decr added in v1.6.0

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

Decr decrease counter.

func (*Cache) Delete added in v1.6.0

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

Delete delete value in memcache.

func (*Cache) Get added in v1.6.0

func (rc *Cache) Get(key string) interface{}

Get get value from memcache.

func (*Cache) GetMulti added in v1.6.0

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

GetMulti get value from memcache.

func (*Cache) Incr added in v1.6.0

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

Incr increase counter.

func (*Cache) IsExist added in v1.6.0

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

IsExist check value exists in memcache.

func (*Cache) Put added in v1.6.0

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

Put put value to memcache. only support string.

func (*Cache) StartAndGC added in v1.6.0

func (rc *Cache) StartAndGC(config string) 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