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 ¶
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
Click to show internal directories.
Click to hide internal directories.