cache

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisStore

type RedisStore struct {
	Client *redis.Client
}

RedisStore implements the Store interface, used for storing objects in-memory

func NewRedisStore

func NewRedisStore(addr string, password string, db int) *RedisStore

NewRedisStore creates a new RedisStore

func (*RedisStore) Delete

func (store *RedisStore) Delete(key string) error

Delete removes a key from the store

func (*RedisStore) Get

func (store *RedisStore) Get(key string) ([]byte, error)

Get returns an object at key

func (*RedisStore) Set

func (store *RedisStore) Set(key string, contents []byte) error

Set saves a new value for key

type Store

type Store interface {
	Get(key string) ([]byte, error)
	Set(key string, contents []byte) error
	Delete(key string) error
}

Store is a generic interface for cache stores

Jump to

Keyboard shortcuts

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