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

Method Keys

internal/lru/lru.go:237–249  ·  view source on GitHub ↗

Keys returns a slice of the keys in the cache, from oldest to newest. Expired entries are filtered out.

()

Source from the content-addressed store, hash-verified

235// Keys returns a slice of the keys in the cache, from oldest to newest.
236// Expired entries are filtered out.
237func (c *LRU[K, V]) Keys() []K {
238 c.mu.RLock()
239 defer c.mu.RUnlock()
240 keys := make([]K, 0, len(c.items))
241 now := time.Now()
242 for ent := c.evictList.Back(); ent != nil; ent = ent.PrevEntry() {
243 if now.After(ent.ExpiresAt) {
244 continue
245 }
246 keys = append(keys, ent.Key)
247 }
248 return keys
249}
250
251// Values returns a slice of the values in the cache, from oldest to newest.
252// 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