LRUCache implements Cache with a Least Recently Used (LRU) cache.
| 13 | |
| 14 | // LRUCache implements Cache with a Least Recently Used (LRU) cache. |
| 15 | type LRUCache struct { |
| 16 | m map[string]*lruNode |
| 17 | head *lruNode |
| 18 | |
| 19 | tail *lruNode |
| 20 | len int |
| 21 | cap int |
| 22 | freelist *lruNode |
| 23 | |
| 24 | invalidStmts []*pgconn.StatementDescription |
| 25 | invalidSet map[string]struct{} |
| 26 | } |
| 27 | |
| 28 | // NewLRUCache creates a new LRUCache. cap is the maximum size of the cache. |
| 29 | func NewLRUCache(cap int) *LRUCache { |
nothing calls this directly
no outgoing calls
no test coverage detected