NewFileCache creates a new file-based cache with optional size limit. maxSize of 0 means unlimited cache size.
(cacheDir string, persisted bool)
| 58 | // NewFileCache creates a new file-based cache with optional size limit. |
| 59 | // maxSize of 0 means unlimited cache size. |
| 60 | func NewFileCache(cacheDir string, persisted bool) (*FileCache, error) { |
| 61 | return NewFileCacheWithSize(cacheDir, persisted, 0) |
| 62 | } |
| 63 | |
| 64 | // NewFileCacheWithSize creates a new file-based cache with a maximum size limit. |
| 65 | // When the cache exceeds maxSize items, least recently used items are evicted. |