Cache is an LRU cache. It is not safe for concurrent access.
| 21 | |
| 22 | // Cache is an LRU cache. It is not safe for concurrent access. |
| 23 | type Cache struct { |
| 24 | // MaxEntries is the maximum number of cache entries before |
| 25 | // an item is evicted. Zero means no limit. |
| 26 | MaxEntries int |
| 27 | |
| 28 | // OnEvicted optionally specifies a callback function to be |
| 29 | // executed when an entry is purged from the cache. |
| 30 | OnEvicted func(key Key, value interface{}) |
| 31 | |
| 32 | ll *list.List |
| 33 | cache map[interface{}]*list.Element |
| 34 | } |
| 35 | |
| 36 | // A Key may be any value that is comparable. See http://golang.org/ref/spec#Comparison_operators |
| 37 | type Key interface{} |
nothing calls this directly
no outgoing calls
no test coverage detected