NewRuntimeCache returns a new *RuntimeCache.
()
| 41 | |
| 42 | // NewRuntimeCache returns a new *RuntimeCache. |
| 43 | func NewRuntimeCache() *RuntimeCache { |
| 44 | cache := RuntimeCache{items: new(sync.Map), gcInterval: DefaultGCInterval} |
| 45 | go cache.gc() |
| 46 | return &cache |
| 47 | } |
| 48 | |
| 49 | // Get cache from runtime cache. |
| 50 | // if non-existed or expired, return nil. |