redis

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefualtPrefix = "tc"

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) Forever

func (r *RedisCache) Forever(key, val string) (err error)

func (*RedisCache) Get

func (r *RedisCache) Get(key string) string

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) MGet

func (r *RedisCache) MGet(keys []string) []string

func (*RedisCache) MSet

func (r *RedisCache) MSet(items map[string]string, timeout int64) (err error)

func (*RedisCache) Set

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

func (*RedisCache) StartAndGC

func (r *RedisCache) StartAndGC(opt tagcache.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
}

Jump to

Keyboard shortcuts

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