Version: v1.4.3 Latest Latest

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

Go to latest
Published: Feb 27, 2015 License: Apache-2.0 Imports: 6 Imported by: 0



package redis for cache provider

depend on

go install

Usage: import(

_ ""


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

more docs



This section is empty.


View Source
var (
	// the collection name of redis for cache adapter.
	DefaultKey string = "beecacheRedis"


This section is empty.


type RedisCache

type RedisCache struct {
	// contains filtered or unexported fields

Redis cache adapter.

func NewRedisCache

func NewRedisCache() *RedisCache

create new redis cache with default collection name.

func (*RedisCache) ClearAll

func (rc *RedisCache) ClearAll() error

clean all cache in redis. delete this redis collection.

func (*RedisCache) Decr

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

decrease counter in redis.

func (*RedisCache) Delete

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

delete cache in redis.

func (*RedisCache) Get

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

Get cache from redis.

func (*RedisCache) Incr

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

increase counter in redis.

func (*RedisCache) IsExist

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

check cache's existence in redis.

func (*RedisCache) Put

func (rc *RedisCache) Put(key string, val interface{}, timeout int64) error

put cache to redis.

func (*RedisCache) StartAndGC

func (rc *RedisCache) StartAndGC(config string) error

start redis cache adapter. config is like {"key":"collection key","conn":"connection info","dbNum":"0"} the cache item in redis are stored forever, so no gc operation.

Source Files

Jump to

Keyboard shortcuts

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