cache

package
v0.0.0-...-ed9082d Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisCacher

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

RedisCacher represents a redis cache adapter implementation.

func (*RedisCacher) Decr

func (c *RedisCacher) Decr(key string) error

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

func (*RedisCacher) Delete

func (c *RedisCacher) Delete(key string) error

Delete deletes cached value by given key.

func (*RedisCacher) Flush

func (c *RedisCacher) Flush() error

Flush deletes all cached data.

func (*RedisCacher) Get

func (c *RedisCacher) Get(key string) interface{}

Get gets cached value by given key.

func (*RedisCacher) Incr

func (c *RedisCacher) Incr(key string) error

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

func (*RedisCacher) IsExist

func (c *RedisCacher) IsExist(key string) bool

IsExist returns true if cached value exists.

func (*RedisCacher) Put

func (c *RedisCacher) Put(key string, val interface{}, expire int64) error

Put puts value into cache with key and expire time. If expired is 0, it lives forever.

func (*RedisCacher) StartAndGC

func (c *RedisCacher) StartAndGC(opts cache.Options) error

StartAndGC starts GC routine based on config string settings. AdapterConfig: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180,hset_name=MacaronCache,prefix=cache:

Jump to

Keyboard shortcuts

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