caching

package
v0.0.0-...-0e65dd1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2015 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 AllErrorCache

type AllErrorCache struct{}

AllErrorCache is used for testing. Every interface that can return an error, does

func (*AllErrorCache) Get

func (simc *AllErrorCache) Get(ns, key string, v interface{}) (miss bool, err error)

func (*AllErrorCache) Set

func (simc *AllErrorCache) Set(ns, key string, v interface{}) error

type BytesCache

type BytesCache interface {
	GetBytes(ns, key string) (result []byte, err error)
	SetBytes(ns, key string, bytes []byte) error
}

type HashCache

type HashCache interface {
	Increment(hashName, fieldName string, by int) (int64, error)
	GetHashInt64(hashName string) (map[string]int64, error)
}

type ListCache

type ListCache interface {
	ListPushRight(listKey string, value []byte) (int64, error)
	ListPopLeft(listKey string) ([]byte, error)
	ListGetRange(listKey string, startIndex, endIndex int) ([]byte, error)
}

type NaiveInMemoryCache

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

NaiveInMemoryCache is used for TESTING! It has no TTL and will eventually eat all memory

func NewNaiveInMemoryCache

func NewNaiveInMemoryCache() *NaiveInMemoryCache

func (*NaiveInMemoryCache) Get

func (simc *NaiveInMemoryCache) Get(ns, key string, v interface{}) (miss bool, err error)

func (*NaiveInMemoryCache) Set

func (simc *NaiveInMemoryCache) Set(ns, key string, v interface{}) error

type NoOpCache

type NoOpCache struct{}

NoOpCache is used to disable caching. All operations miss or do nothing

func (*NoOpCache) Get

func (noc *NoOpCache) Get(ns, key string, instance interface{}) (miss bool, err error)

func (*NoOpCache) Set

func (noc *NoOpCache) Set(ns, key string, instance interface{}) error

type ObjectCache

type ObjectCache interface {
	Get(ns, key string, instance interface{}) (miss bool, err error)
	Set(ns, key string, instance interface{}) error
}

type SetCache

type SetCache interface {
	SetAdd(listKey string, member []byte) (int, error)
	SetMembers(listKey string) ([][]byte, error)
	SetRemove(listKey string, member []byte) (int, error)
}

Jump to

Keyboard shortcuts

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