(defaultExpiration time.Duration, cleanupInterval time.Duration, items map[string]Item)
| 270 | } |
| 271 | |
| 272 | func newCacheWithJanitor(defaultExpiration time.Duration, cleanupInterval time.Duration, items map[string]Item) *Cache { |
| 273 | c := newCache(defaultExpiration, items) |
| 274 | //init Cache |
| 275 | C := &Cache{c} |
| 276 | if cleanupInterval > 0 { |
| 277 | runJanitor(c, cleanupInterval) |
| 278 | runtime.SetFinalizer(C, stopJanitor) |
| 279 | } |
| 280 | return C |
| 281 | } |
| 282 | |
| 283 | func New(defaultExpiration, cleanupInterval time.Duration) *Cache { |
| 284 | items := make(map[string]Item) |
no test coverage detected