MCPcopy
hub / github.com/go-gorm/gorm / KeyValues

Method KeyValues

internal/lru/lru.go:220–233  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

218}
219
220func (c *LRU[K, V]) KeyValues() map[K]V {
221 c.mu.RLock()
222 defer c.mu.RUnlock()
223 maps := make(map[K]V)
224 now := time.Now()
225 for ent := c.evictList.Back(); ent != nil; ent = ent.PrevEntry() {
226 if now.After(ent.ExpiresAt) {
227 continue
228 }
229 maps[ent.Key] = ent.Value
230 // keys = append(keys, ent.Key)
231 }
232 return maps
233}
234
235// Keys returns a slice of the keys in the cache, from oldest to newest.
236// Expired entries are filtered out.

Callers

nothing calls this directly

Calls 3

BackMethod · 0.80
PrevEntryMethod · 0.80
AfterMethod · 0.45

Tested by

no test coverage detected