add Keys() function to private cache interface for completeness.
@@ -8,12 +8,15 @@ type cache interface {
Remove(key interface{})
Contains(key interface{}) bool
Peek(key interface{}) (value interface{}, ok bool)
+ Keys() []interface{}
}
// noopCache is a dummy implementation that's used when the cache is disabled.
type noopCache struct {
}
+var _ cache = (*noopCache)(nil)
+
func (*noopCache) Get(key interface{}) (value interface{}, ok bool) {
return nil, false
}
@@ -31,3 +34,7 @@ func (*noopCache) Contains(key interface{}) bool {
func (*noopCache) Peek(key interface{}) (value interface{}, ok bool) {
return nil, false
}
+
+func (*noopCache) Keys() (keys []interface{}) {
+ return keys
+}
