cache

package
v0.0.0-...-4347b6b Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const KeySeparator = "."

KeySeparator is used to build complete keys out of parts.

Variables

View Source
var (
	ErrKeyNotFound = errors.New("key not found")
)

Common errors for Event implementations.

Functions

func IsKeyNotFound

func IsKeyNotFound(err error) bool

IsKeyNotFound checks if err is ErrKeyNotFound.

Types

type CountService

type CountService interface {
	Decr(namespace, key string) (int, error)
	Get(namespace, key string) (int, error)
	Incr(namespace, key string) (int, error)
	Set(namespace, key string, count int) error
}

CountService caches counts separated by namespace.

func RedisCountService

func RedisCountService(pool *redis.Pool) CountService

type CountServiceMiddleware

type CountServiceMiddleware func(CountService) CountService

CountServiceMiddleware is a chainable behaviour modifier for CountService.

func InstrumentCountServiceMiddleware

func InstrumentCountServiceMiddleware(
	component, service, store string,
	errCount kitmetrics.Counter,
	hitCount kitmetrics.Counter,
	opCount kitmetrics.Counter,
	opLatency *prometheus.HistogramVec,
) CountServiceMiddleware

type Error

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

Error wraps common Event errors.

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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