Documentation ¶
Index ¶
- type RedisCache
- func (rc *RedisCache) Add(key string, delta int64) error
- func (rc *RedisCache) ClearAll() error
- func (rc *RedisCache) Decr(key string) error
- func (rc *RedisCache) Delete(key string) error
- func (rc *RedisCache) Get(key string) (interface{}, error)
- func (rc *RedisCache) GetBytes(key string) ([]byte, error)
- func (rc *RedisCache) GetMulti(keys []string) []interface{}
- func (rc *RedisCache) GetString(key string) (string, error)
- func (rc *RedisCache) Incr(key string) error
- func (rc *RedisCache) IsExist(key string) bool
- func (rc *RedisCache) Put(key string, val interface{}) error
- func (rc *RedisCache) PutWithTimeout(key string, val interface{}, timeout time.Duration) error
- func (rc *RedisCache) RandSetMember(key string) (interface{}, error)
- func (rc *RedisCache) SetSet(key string, values ...interface{}) (interface{}, error)
- func (rc *RedisCache) StartAndGC(config string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
Redis cache adapter.
func RedisInit ¶
func RedisInit(redisServer string) (*RedisCache, error)
func (*RedisCache) ClearAll ¶
func (rc *RedisCache) ClearAll() error
clean all cache in redis. delete this redis collection.
func (*RedisCache) Get ¶
func (rc *RedisCache) Get(key string) (interface{}, error)
Get cache from redis.
func (*RedisCache) GetMulti ¶
func (rc *RedisCache) GetMulti(keys []string) []interface{}
GetMulti get cache from 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{}) error
func (*RedisCache) PutWithTimeout ¶
func (rc *RedisCache) PutWithTimeout(key string, val interface{}, timeout time.Duration) error
put cache to redis.
func (*RedisCache) RandSetMember ¶
func (rc *RedisCache) RandSetMember(key string) (interface{}, error)
func (*RedisCache) SetSet ¶
func (rc *RedisCache) SetSet(key string, values ...interface{}) (interface{}, error)
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.
Click to show internal directories.
Click to hide internal directories.