MCPcopy Create free account
hub / github.com/Creatly/creatly-backend / Set

Method Set

pkg/cache/memory.go:44–54  ·  view source on GitHub ↗
(key, value interface{}, ttl int64)

Source from the content-addressed store, hash-verified

42}
43
44func (c *MemoryCache) Set(key, value interface{}, ttl int64) error {
45 c.Lock()
46 c.cache[key] = &item{
47 value: value,
48 createdAt: time.Now().Unix(),
49 ttl: ttl,
50 }
51 c.Unlock()
52
53 return nil
54}
55
56func (c *MemoryCache) Get(key interface{}) (interface{}, error) {
57 c.RLock()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected