redis

package
v0.0.0-...-10dc113 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2017 License: MIT, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const GC_HASH_KEY = "TagCache:CacheGCKeys"

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisCache

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

func (*RedisCache) Decr

func (r *RedisCache) Decr(key string) (int64, error)

Decr decreases cached int-type value by given key as a counter.

func (*RedisCache) Delete

func (r *RedisCache) Delete(key string) (err error)

Delete deletes cached value by given key.

func (*RedisCache) Flush

func (r *RedisCache) Flush() (err error)

Flush deletes all cached data.

func (*RedisCache) Get

func (r *RedisCache) Get(key string, _val interface{}) error

func (*RedisCache) Incr

func (r *RedisCache) Incr(key string) (int64, error)

Incr increases cached int-type value by given key as a counter.

func (*RedisCache) IsExist

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

IsExist returns true if cached value exists.

func (*RedisCache) Set

func (r *RedisCache) Set(key string, val interface{}, timeout int64) (err error)

func (*RedisCache) StartAndGC

func (r *RedisCache) StartAndGC(opt cache.Options) error

StartAndGC starts GC routine based on config string settings.

func (*RedisCache) Touch

func (r *RedisCache) Touch(key string, expire int64) (err error)

update expire time

type RedisConfig

type RedisConfig struct {
	Addr        string
	Passwd      string
	SelectDB    int
	MaxIdle     int
	MaxActive   int
	IdleTimeout int
	Wait        bool
	OccupyMode  bool // use whole db
}

Jump to

Keyboard shortcuts

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