Versions in this module Expand all Collapse all v0 v0.2.0 Jul 30, 2026 v0.1.0 Jul 22, 2026 Changes in this version + var ErrNegativeTTL = errors.New("cache: ttl must not be negative") + type BadgerCache struct + func NewBadgerCache(dir string, logger *slog.Logger) (*BadgerCache, error) + func (c *BadgerCache) Close() error + func (c *BadgerCache) Delete(_ context.Context, key string) error + func (c *BadgerCache) Get(_ context.Context, key string) ([]byte, bool, error) + func (c *BadgerCache) RunGC(ctx context.Context, interval time.Duration) + func (c *BadgerCache) RunValueLogGCOnce(discardRatio float64) error + func (c *BadgerCache) Set(_ context.Context, key string, value []byte, ttl time.Duration) error + type Cache interface + Delete func(ctx context.Context, key string) error + Get func(ctx context.Context, key string) (value []byte, ok bool, err error) + Set func(ctx context.Context, key string, value []byte, ttl time.Duration) error + type MemoryCache struct + func NewMemoryCache() *MemoryCache + func (c *MemoryCache) Delete(_ context.Context, key string) error + func (c *MemoryCache) Get(_ context.Context, key string) ([]byte, bool, error) + func (c *MemoryCache) Set(_ context.Context, key string, value []byte, ttl time.Duration) error