ResponseCacheProvider defines the interface for response caching. This is implemented by the service layer (serv package) to provide Redis-based caching with row-level invalidation.
| 11 | // This is implemented by the service layer (serv package) to provide |
| 12 | // Redis-based caching with row-level invalidation. |
| 13 | type ResponseCacheProvider interface { |
| 14 | // Get retrieves a cached response by key. |
| 15 | // Returns (data, isStale, found). isStale is true if the entry is past soft TTL (SWR). |
| 16 | Get(ctx context.Context, key string) (data []byte, isStale bool, found bool) |
| 17 | |
| 18 | // Set stores a response with dependency refs for invalidation. |
| 19 | // refs may represent DB rows/tables, filesystem keys/prefixes, or resolver outputs. |
| 20 | // queryStartTime is used for race condition detection. |
| 21 | Set(ctx context.Context, key string, data []byte, refs []RowRef, queryStartTime time.Time) error |
| 22 | |
| 23 | // InvalidateRows invalidates cache entries for dependency refs. |
| 24 | InvalidateRows(ctx context.Context, refs []RowRef) error |
| 25 | } |
| 26 | |
| 27 | // CacheEntryOptions lets callers narrow cache lifetime for one entry without |
| 28 | // changing provider-wide defaults. |
no outgoing calls
no test coverage detected