MCPcopy Create free account
hub / github.com/patrickmn/go-cache / NewFrom

Function NewFrom

cache.go:1159–1161  ·  view source on GitHub ↗

Return a new cache with a given default expiration duration and cleanup interval. If the expiration duration is less than one (or NoExpiration), the items in the cache never expire (by default), and must be deleted manually. If the cleanup interval is less than one, expired items are not deleted fro

(defaultExpiration, cleanupInterval time.Duration, items map[string]Item)

Source from the content-addressed store, hash-verified

1157// map retrieved with c.Items(), and to register those same types before
1158// decoding a blob containing an items map.
1159func NewFrom(defaultExpiration, cleanupInterval time.Duration, items map[string]Item) *Cache {
1160 return newCacheWithJanitor(defaultExpiration, cleanupInterval, items)
1161}

Callers 1

TestNewFromFunction · 0.85

Calls 1

newCacheWithJanitorFunction · 0.85

Tested by 1

TestNewFromFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…