MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / SetWithExpirable

Method SetWithExpirable

internal/cache/keyed_cache.go:31–39  ·  view source on GitHub ↗
(key string, value T, exp Expirable)

Source from the content-addressed store, hash-verified

29}
30
31func (c *KeyedCache[T]) SetWithExpirable(key string, value T, exp Expirable) {
32 c.mu.Lock()
33 defer c.mu.Unlock()
34
35 c.entries[key] = &CacheEntry[T]{
36 data: value,
37 Expirable: exp,
38 }
39}
40
41func (c *KeyedCache[T]) Get(key string) (T, bool) {
42 c.mu.RLock()

Callers 3

SetMethod · 0.95
SetWithTTLMethod · 0.95
DriverExtractFunction · 0.80

Calls 1

UnlockMethod · 0.65

Tested by

no test coverage detected