redis

package
v0.0.0-...-00e0705 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(pool *redis.Pool, prefix string) cache.Cache

New open a redis cache

Types

type Cache

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

Cache redis cache adapter.

func (*Cache) Clear

func (p *Cache) Clear() error

Clear clear all cache.

func (*Cache) Get

func (p *Cache) Get(key string, val interface{}) error

Get get cached value by key.

func (*Cache) Put

func (p *Cache) Put(key string, val interface{}, ttl time.Duration) error

Put cached value with key and expire time.

func (*Cache) Status

func (p *Cache) Status() (map[string]int, error)

Status list all items

Jump to

Keyboard shortcuts

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