https://github.com/hashicorp/golang-lru/compare/0fb14efe8c47ae851c0034ed7a448854d3d34cf3...7087cb70de9f7a8bc0a10c375cb0d2280a8edf9c
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
... | ... |
@@ -140,7 +140,7 @@ golang.org/x/crypto 38d8ce5564a5b71b2e3a00553993 |
140 | 140 |
golang.org/x/time fbb02b2291d28baffd63558aa44b4b56f178d650 |
141 | 141 |
github.com/hashicorp/go-memdb cb9a474f84cc5e41b273b20c6927680b2a8776ad |
142 | 142 |
github.com/hashicorp/go-immutable-radix 826af9ccf0feeee615d546d69b11f8e98da8c8f1 git://github.com/tonistiigi/go-immutable-radix.git |
143 |
-github.com/hashicorp/golang-lru 0fb14efe8c47ae851c0034ed7a448854d3d34cf3 |
|
143 |
+github.com/hashicorp/golang-lru 7087cb70de9f7a8bc0a10c375cb0d2280a8edf9c # v0.5.1 |
|
144 | 144 |
github.com/coreos/pkg 3ac0863d7acf3bc44daf49afef8919af12f704ef # v3 |
145 | 145 |
github.com/pivotal-golang/clock 3fd3c1944c59d9742e1cd333672181cd1a6f9fa0 |
146 | 146 |
|
... | ... |
@@ -1,37 +1,36 @@ |
1 | 1 |
package simplelru |
2 | 2 |
|
3 |
- |
|
4 | 3 |
// LRUCache is the interface for simple LRU cache. |
5 | 4 |
type LRUCache interface { |
6 |
- // Adds a value to the cache, returns true if an eviction occurred and |
|
7 |
- // updates the "recently used"-ness of the key. |
|
8 |
- Add(key, value interface{}) bool |
|
5 |
+ // Adds a value to the cache, returns true if an eviction occurred and |
|
6 |
+ // updates the "recently used"-ness of the key. |
|
7 |
+ Add(key, value interface{}) bool |
|
9 | 8 |
|
10 |
- // Returns key's value from the cache and |
|
11 |
- // updates the "recently used"-ness of the key. #value, isFound |
|
12 |
- Get(key interface{}) (value interface{}, ok bool) |
|
9 |
+ // Returns key's value from the cache and |
|
10 |
+ // updates the "recently used"-ness of the key. #value, isFound |
|
11 |
+ Get(key interface{}) (value interface{}, ok bool) |
|
13 | 12 |
|
14 |
- // Check if a key exsists in cache without updating the recent-ness. |
|
15 |
- Contains(key interface{}) (ok bool) |
|
13 |
+ // Check if a key exsists in cache without updating the recent-ness. |
|
14 |
+ Contains(key interface{}) (ok bool) |
|
16 | 15 |
|
17 |
- // Returns key's value without updating the "recently used"-ness of the key. |
|
18 |
- Peek(key interface{}) (value interface{}, ok bool) |
|
16 |
+ // Returns key's value without updating the "recently used"-ness of the key. |
|
17 |
+ Peek(key interface{}) (value interface{}, ok bool) |
|
19 | 18 |
|
20 |
- // Removes a key from the cache. |
|
21 |
- Remove(key interface{}) bool |
|
19 |
+ // Removes a key from the cache. |
|
20 |
+ Remove(key interface{}) bool |
|
22 | 21 |
|
23 |
- // Removes the oldest entry from cache. |
|
24 |
- RemoveOldest() (interface{}, interface{}, bool) |
|
22 |
+ // Removes the oldest entry from cache. |
|
23 |
+ RemoveOldest() (interface{}, interface{}, bool) |
|
25 | 24 |
|
26 |
- // Returns the oldest entry from the cache. #key, value, isFound |
|
27 |
- GetOldest() (interface{}, interface{}, bool) |
|
25 |
+ // Returns the oldest entry from the cache. #key, value, isFound |
|
26 |
+ GetOldest() (interface{}, interface{}, bool) |
|
28 | 27 |
|
29 |
- // Returns a slice of the keys in the cache, from oldest to newest. |
|
30 |
- Keys() []interface{} |
|
28 |
+ // Returns a slice of the keys in the cache, from oldest to newest. |
|
29 |
+ Keys() []interface{} |
|
31 | 30 |
|
32 |
- // Returns the number of items in the cache. |
|
33 |
- Len() int |
|
31 |
+ // Returns the number of items in the cache. |
|
32 |
+ Len() int |
|
34 | 33 |
|
35 |
- // Clear all cache entries |
|
36 |
- Purge() |
|
34 |
+ // Clear all cache entries |
|
35 |
+ Purge() |
|
37 | 36 |
} |