redis

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedisCache

func NewRedisCache(config *internal.CacheConfig) internal.Cacher

Types

type RCache

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

func (*RCache) ClearAll

func (c *RCache) ClearAll() (err error)

FlushAll clear all cached in redis

func (*RCache) Decrement

func (c *RCache) Decrement(key string) (err error)

Decr decrease counter in redis.

func (*RCache) Delete

func (c *RCache) Delete(key string) (err error)

func (*RCache) Get

func (c *RCache) Get(key string) (result interface{}, err error)

func (*RCache) GetJson

func (c *RCache) GetJson(key string, val interface{}) error

Get cached Json value by key.

func (*RCache) Increment

func (c *RCache) Increment(key string) (err error)

Incr increase counter in redis.

func (*RCache) Put

func (c *RCache) Put(key string, val interface{}, timeout time.Duration) (err error)

func (*RCache) PutJson

func (c *RCache) PutJson(key string, val interface{}, timeout time.Duration) error

Put Json value with key and expire time

func (*RCache) Touch

func (c *RCache) Touch(key string, timeout time.Duration) (err error)

Jump to

Keyboard shortcuts

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