MCPcopy
hub / github.com/kubernetes/client-go / getTimestampedEntry

Method getTimestampedEntry

tools/cache/expiration_cache.go:80–86  ·  view source on GitHub ↗

getTimestampedEntry returns the TimestampedEntry stored under the given key.

(key string)

Source from the content-addressed store, hash-verified

78
79// getTimestampedEntry returns the TimestampedEntry stored under the given key.
80func (c *ExpirationCache) getTimestampedEntry(key string) (*TimestampedEntry, bool) {
81 item, _ := c.cacheStorage.Get(key)
82 if tsEntry, ok := item.(*TimestampedEntry); ok {
83 return tsEntry, true
84 }
85 return nil, false
86}
87
88// getOrExpire retrieves the object from the TimestampedEntry if and only if it hasn't
89// already expired. It holds a write lock across deletion.

Callers 1

getOrExpireMethod · 0.95

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected