feat: wire context store scaffolding and dht test skeleton

This commit is contained in:
anthonyrawlins
2025-09-28 14:21:38 +10:00
parent d074520c30
commit ae021b47b9
7 changed files with 266 additions and 12 deletions

View File

@@ -0,0 +1,46 @@
package storage
import (
"context"
"time"
)
// noopCacheManager satisfies CacheManager when external cache infrastructure is unavailable.
type noopCacheManager struct{}
// NewNoopCacheManager returns a cache manager that always misses and performs no persistence.
func NewNoopCacheManager() CacheManager {
return &noopCacheManager{}
}
func (n *noopCacheManager) Get(ctx context.Context, key string) (interface{}, bool, error) {
return nil, false, nil
}
func (n *noopCacheManager) Set(ctx context.Context, key string, data interface{}, ttl time.Duration) error {
return nil
}
func (n *noopCacheManager) Delete(ctx context.Context, key string) error {
return nil
}
func (n *noopCacheManager) DeletePattern(ctx context.Context, pattern string) error {
return nil
}
func (n *noopCacheManager) Clear(ctx context.Context) error {
return nil
}
func (n *noopCacheManager) Warm(ctx context.Context, keys []string) error {
return nil
}
func (n *noopCacheManager) GetCacheStats() (*CacheStatistics, error) {
return &CacheStatistics{}, nil
}
func (n *noopCacheManager) SetCachePolicy(policy *CachePolicy) error {
return nil
}