cache

package
v0.0.0-...-de4e6b7 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCacheMiss  = errors.New("cache: key not found.")
	ErrNotStored  = errors.New("cache: not stored.")
	ErrNotSupport = errors.New("cache: not support.")
)

Functions

This section is empty.

Types

type CacheStore

type CacheStore interface {
	GetString(key string) (string, error)
	GetInt(key string) (int, error)
	Set(key string, value interface{}) error
	Delete(key string) error
	Increment(key string, data uint64) (uint64, error)
	Decrement(key string, data uint64) (uint64, error)
	HashSet(key string, values []string) error
}

type RedisStore

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

func NewRedisCache

func NewRedisCache(host string, password string) (*RedisStore, error)

func (*RedisStore) Decrement

func (c *RedisStore) Decrement(key string, delta uint64) (newValue uint64, err error)

func (*RedisStore) Delete

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

func (*RedisStore) GetInt

func (c *RedisStore) GetInt(key string) (int, error)

func (*RedisStore) GetString

func (c *RedisStore) GetString(key string) (string, error)

func (*RedisStore) HashSet

func (c *RedisStore) HashSet(key string, values []string) error

func (*RedisStore) Increment

func (c *RedisStore) Increment(key string, delta uint64) (uint64, error)

func (*RedisStore) Set

func (c *RedisStore) Set(key string, value interface{}) error

Jump to

Keyboard shortcuts

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