RedisCache provides Redis-based response caching with row-level invalidation
| 48 | |
| 49 | // RedisCache provides Redis-based response caching with row-level invalidation |
| 50 | type 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 |
| 70 | func NewRedisCache(redisURL string, conf CachingConfig) (*RedisCache, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected