github.com/go-eden/common@v0.1.15-0.20210617133546-059099253264/esync/syn_map.go (about) 1 package esync 2 3 import "sync/atomic" 4 5 type RMap struct { 6 m atomic.Value 7 } 8 9 func (t *RMap) Get(key interface{}) (value interface{}) { 10 m := t.m.Load() 11 if m != nil { 12 value = m.(map[interface{}]interface{})[key] 13 } 14 return nil 15 } 16 17 func (t *RMap) Set(key, value interface{}) { 18 m := t.m.Load() 19 if m != nil { 20 value = m.(map[interface{}]interface{})[key] 21 } 22 } 23 24 func (t *RMap) Del(key interface{}) { 25 26 }