FileCache implements a simple file-based cache with LRU eviction.
| 41 | |
| 42 | // FileCache implements a simple file-based cache with LRU eviction. |
| 43 | type FileCache struct { |
| 44 | dir string |
| 45 | mutex sync.RWMutex |
| 46 | inMemory map[string]*list.Element // Map key to list element |
| 47 | lruList *list.List // Doubly-linked list for LRU tracking |
| 48 | maxSize int // Maximum number of items (0 = unlimited) |
| 49 | persisted bool |
| 50 | } |
| 51 | |
| 52 | // lruEntry represents an entry in the LRU cache. |
| 53 | type lruEntry struct { |
nothing calls this directly
no outgoing calls
no test coverage detected