Versions in this module Expand all Collapse all v2 v2.0.2 Jul 2, 2026 Changes in this version type Manager + Shutdown func(ctx context.Context) error v2.0.1 Jun 29, 2026 Changes in this version + type Cache interface + Close func() error + Delete func(ctx context.Context, key K) error + Exists func(ctx context.Context, key K) (bool, error) + Flush func(ctx context.Context) error + Get func(ctx context.Context, key K) (V, bool, error) + Set func(ctx context.Context, key K, value V, ttl time.Duration) error + func GetCache[K comparable, V any](manager Manager, name string, keyFunc func(K) string) (Cache[K, V], bool) + func NewGenericCache[K comparable, V any](raw RawCache, keyFunc func(K) string) Cache[K, V] + type GenericCache struct + func (g *GenericCache[K, V]) Close() error + func (g *GenericCache[K, V]) Delete(ctx context.Context, key K) error + func (g *GenericCache[K, V]) Exists(ctx context.Context, key K) (bool, error) + func (g *GenericCache[K, V]) Flush(ctx context.Context) error + func (g *GenericCache[K, V]) Get(ctx context.Context, key K) (V, bool, error) + func (g *GenericCache[K, V]) Set(ctx context.Context, key K, value V, ttl time.Duration) error + type InMemoryCache struct + func (c *InMemoryCache) Close() error + func (c *InMemoryCache) Decrement(ctx context.Context, key string, delta int64) (int64, error) + func (c *InMemoryCache) Delete(_ context.Context, key string) error + func (c *InMemoryCache) Exists(_ context.Context, key string) (bool, error) + func (c *InMemoryCache) Expire(_ context.Context, key string, ttl time.Duration) error + func (c *InMemoryCache) Flush(_ context.Context) error + func (c *InMemoryCache) Get(_ context.Context, key string) ([]byte, bool, error) + func (c *InMemoryCache) Increment(_ context.Context, key string, delta int64) (int64, error) + func (c *InMemoryCache) Set(_ context.Context, key string, value []byte, ttl time.Duration) error + func (c *InMemoryCache) SupportsPerKeyTTL() bool + type Manager interface + AddCache func(name string, cache RawCache) + Close func() error + GetRawCache func(name string) (RawCache, bool) + RemoveCache func(name string) error + func NewManager() Manager + type Option func(*Options) + func WithCredsFile(credsFile string) Option + func WithDSN(dsn data.DSN) Option + func WithMaxAge(maxAge time.Duration) Option + func WithName(name string) Option + type Options struct + CredsFile string + DSN data.DSN + MaxAge time.Duration + Name string + type RawCache interface + Close func() error + Decrement func(ctx context.Context, key string, delta int64) (int64, error) + Delete func(ctx context.Context, key string) error + Exists func(ctx context.Context, key string) (bool, error) + Expire func(ctx context.Context, key string, ttl time.Duration) error + Flush func(ctx context.Context) error + Get func(ctx context.Context, key string) ([]byte, bool, error) + Increment func(ctx context.Context, key string, delta int64) (int64, error) + Set func(ctx context.Context, key string, value []byte, ttl time.Duration) error + SupportsPerKeyTTL func() bool + func NewInMemoryCache() RawCache Other modules containing this package github.com/pitabwire/frame