Returns a new random replacement key-only cache that can potentially grow upto the provided size.
(size int)
| 106 | // Returns a new random replacement key-only cache that can |
| 107 | // potentially grow upto the provided size. |
| 108 | func NewRandReplKeyCache(size int) *RandReplKeyCache { |
| 109 | return &RandReplKeyCache{ |
| 110 | size: size, |
| 111 | cache: make(map[string]struct{}), |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | // Contains returns true if the provided key is present |
| 116 | // in the cache and false otherwise. |
no outgoing calls