Versions in this module Expand all Collapse all v1 v1.0.0 Aug 25, 2023 Changes in this version + type Cache interface + Delete func(ctx context.Context, key string) error + Get func(ctx context.Context, key string, value interface{}) error + HealthCheck func(ctx context.Context) error + Keys func(ctx context.Context, key string) ([]string, error) + Set func(ctx context.Context, key string, value interface{}) error + func NewMemoizeCache(rc redis.UniversalClient, defaultExpiration, cleanupInterval time.Duration, ...) Cache + type DoFn func(item *cache.Item) (interface{}, error) + type KeyValCache struct + func NewKeyValCache(rc redis.UniversalClient, opts ...Options) *KeyValCache + func (k *KeyValCache) Delete(ctx context.Context, key string) error + func (k *KeyValCache) Get(ctx context.Context, key string, value interface{}) error + func (k *KeyValCache) HealthCheck(ctx context.Context) error + func (k *KeyValCache) Keys(ctx context.Context, key string) ([]string, error) + func (k *KeyValCache) Set(ctx context.Context, key string, value interface{}) error + type MemCache struct + func NewMemCache() MemCache + func (m MemCache) Delete(ctx context.Context, key string) error + func (m MemCache) Get(ctx context.Context, key string, v interface{}) error + func (m MemCache) HealthCheck(ctx context.Context) error + func (m MemCache) Keys(ctx context.Context, key string) ([]string, error) + func (m MemCache) Set(ctx context.Context, key string, value interface{}) error + type MemoizeMetrics struct + func NewMemoizeMetrics(label string, reg *prometheus.Registry) MemoizeMetrics + type MetricsCache struct + func NewMetricsCache(label string, reg prometheus.Registerer, next Cache) MetricsCache + func (c MetricsCache) Delete(ctx context.Context, key string) (err error) + func (c MetricsCache) Get(ctx context.Context, key string, v interface{}) (err error) + func (c MetricsCache) HealthCheck(ctx context.Context) error + func (c MetricsCache) Keys(ctx context.Context, key string) ([]string, error) + func (c MetricsCache) Set(ctx context.Context, key string, value interface{}) (err error) + type Options func(k *KeyValCache) + func WithLocalCache(lc cache.LocalCache) Options + func WithMarshalFunc(marshalFunc cache.MarshalFunc) Options + func WithTTL(ttl time.Duration) Options + func WithUnmarshalFunc(unmarshalFunc cache.UnmarshalFunc) Options + type Wrapper struct + func NewWrapper(cache Cache, environment string, l log.Logger) *Wrapper + func (wrapper *Wrapper) Contains(key interface{}) bool + func (wrapper *Wrapper) Get(key interface{}) (value interface{}, ok bool) + func (wrapper *Wrapper) Keys() []interface{} + func (wrapper *Wrapper) Len() int + func (wrapper *Wrapper) Purge() + func (wrapper *Wrapper) Remove(key interface{}) (present bool) + func (wrapper *Wrapper) Resize(size int) (evicted int) + func (wrapper *Wrapper) Set(key interface{}, value interface{}) (evicted bool) + func (wrapper *Wrapper) SetLogger(l logger.Logger) + func (wrapper *Wrapper) Updated() time.Time