Versions in this module Expand all Collapse all v1 v1.0.0 Mar 7, 2026 Changes in this version + type CacheWarmer struct + func NewCacheWarmer(cache *MultiLevelCache) *CacheWarmer + func (cw *CacheWarmer) Warmup(ctx context.Context, data map[string]any) error + func (cw *CacheWarmer) WarmupByKeys(ctx context.Context, keys []string, valueFn func(string) any) error + func (cw *CacheWarmer) WarmupWithTTL(ctx context.Context, data map[string]any, ttl time.Duration) error + type MultiLevelCache struct + func NewMultiLevelCache(l1, l2 port.CachePort) *MultiLevelCache + func NewMultiLevelCacheWithTTL(l1, l2 port.CachePort, l1TTL, l2TTL, promotionTTL time.Duration) *MultiLevelCache + func (mlc *MultiLevelCache) Clear(ctx context.Context) error + func (mlc *MultiLevelCache) Delete(ctx context.Context, key string) error + func (mlc *MultiLevelCache) Get(ctx context.Context, key string) (any, error) + func (mlc *MultiLevelCache) GetPromotionCount() int64 + func (mlc *MultiLevelCache) GetPromotionTTL() time.Duration + func (mlc *MultiLevelCache) Set(ctx context.Context, key string, value any, ttl time.Duration) error + func (mlc *MultiLevelCache) SetPromotionTTL(ttl time.Duration) + func (mlc *MultiLevelCache) Stats() *port.CacheStats + type StampedeProtection struct + func NewStampedeProtection() *StampedeProtection + func (sp *StampedeProtection) Do(key string, fn func() (any, error)) (any, error) + type TTLManager struct + func NewTTLManager() *TTLManager + func (tm *TTLManager) CleanupExpired() int + func (tm *TTLManager) Delete(key string) + func (tm *TTLManager) GetRemaining(key string) time.Duration + func (tm *TTLManager) IsExpired(key string) bool + func (tm *TTLManager) Set(key string, ttl time.Duration)