123456789101112131415161718192021222324252627 |
- package cache
- /*
- var (
- cache sync.Map
- )
- // Get key from cache
- func Get(key interface{}) (interface{}, bool) {
- return cache.Load(key)
- }
- // Set key-value to cache
- func Set(key, value interface{}) {
- cache.Store(key, value)
- }
- // Del delete key from cache
- func Del(key interface{}) {
- cache.Delete(key)
- }
- // Range list cache
- func Range(cb func(k, v interface{}) bool) {
- cache.Range(cb)
- }
- // */
|