Entries returns the number of entries in the cache
()
| 248 | |
| 249 | // Entries returns the number of entries in the cache |
| 250 | func (c *Cache) Entries() int { |
| 251 | c.mu.Lock() |
| 252 | entries := len(c.cache) |
| 253 | c.mu.Unlock() |
| 254 | return entries |
| 255 | } |
| 256 | |
| 257 | // SetFinalizer sets a function to be called when a value drops out of the cache |
| 258 | func (c *Cache) SetFinalizer(finalize func(any)) { |