cache

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(string, string) error
	Get(string) ([]byte, error)
	Subscribe(string, func()) error
}

func NewCache

func NewCache(address string) Cache

NewCache returns a new instance of the cache with a prepared connection pool

type RedisCache added in v0.3.0

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

RedisCache holds the connection pool for an instance of the cache

func (*RedisCache) Get added in v0.3.0

func (c *RedisCache) Get(key string) ([]byte, error)

Get retrieves a key from redis

func (*RedisCache) Set added in v0.3.0

func (c *RedisCache) Set(key, value string) error

Set sets a key to a value

func (*RedisCache) Subscribe added in v0.3.0

func (c *RedisCache) Subscribe(channel string, action func()) error

Subscribe subscribes to a key and calls a function when messages are received

Jump to

Keyboard shortcuts

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