NewMemoryCache creates an in-memory only cache (no persistence).
()
| 325 | |
| 326 | // NewMemoryCache creates an in-memory only cache (no persistence). |
| 327 | func NewMemoryCache() *FileCache { |
| 328 | return &FileCache{ |
| 329 | inMemory: make(map[string]*list.Element), |
| 330 | lruList: list.New(), |
| 331 | maxSize: 0, // Unlimited |
| 332 | persisted: false, |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | // NewMemoryCacheWithSize creates an in-memory cache with a size limit. |
| 337 | func NewMemoryCacheWithSize(maxSize int) *FileCache { |
no outgoing calls