MCPcopy Create free account
hub / github.com/devfeel/dotweb / Set

Method Set

cache/runtime/cache_runtime.go:108–111  ·  view source on GitHub ↗

Set cache to runtime. ttl is second, if ttl is 0, it will be forever till restart.

(key string, value interface{}, ttl int64)

Source from the content-addressed store, hash-verified

106// Set cache to runtime.
107// ttl is second, if ttl is 0, it will be forever till restart.
108func (ca *RuntimeCache) Set(key string, value interface{}, ttl int64) error {
109 ca.initValue(key, value, ttl)
110 return nil
111}
112
113func (ca *RuntimeCache) initValue(key string, value interface{}, ttl int64) error {
114 ca.items.Store(key, &RuntimeItem{

Calls 1

initValueMethod · 0.95