MCPcopy
hub / github.com/dosco/graphjin / RedisCache

Struct RedisCache

serv/cache_redis.go:50–67  ·  view source on GitHub ↗

RedisCache provides Redis-based response caching with row-level invalidation

Source from the content-addressed store, hash-verified

48
49// RedisCache provides Redis-based response caching with row-level invalidation
50type RedisCache struct {
51 client *redis.Client
52 conf CachingConfig
53 workerPool *SWRWorkerPool
54 metrics *CacheMetrics
55 available atomic.Bool
56 lastCheck atomic.Int64
57 excludeTable map[string]bool
58
59 // OpenTelemetry metric instruments
60 otelHitCounter metric.Int64Counter
61 otelMissCounter metric.Int64Counter
62 otelInvalidationCounter metric.Int64Counter
63 otelErrorCounter metric.Int64Counter
64 otelSWRRefreshCounter metric.Int64Counter
65 otelBytesCachedGauge metric.Int64UpDownCounter
66 otelBytesSavedGauge metric.Int64UpDownCounter
67}
68
69// NewRedisCache creates a new Redis cache instance
70func NewRedisCache(redisURL string, conf CachingConfig) (*RedisCache, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected