Documentation ¶
Overview ¶
线程安全的map。
示例:
var safeMap SafeMap = New() safeMap.Set(13, 14) safeMap.Set(15, "hello") e := safeMap.Iterate(func(key interface{}, value interface{}) error { fmt.Println(key, value) return nil }) if e != nil { fmt.Println(e.Error()) }
Index ¶
- type SafeMap
- func (sm *SafeMap) Del(key interface{})
- func (sm *SafeMap) Get(key interface{}) (value interface{}, exist bool)
- func (sm *SafeMap) GetAndDo(key interface{}, do func(value interface{}, exist bool))
- func (sm *SafeMap) Iterate(iter func(key interface{}, value interface{}) error) error
- func (sm *SafeMap) Len() (length int)
- func (sm *SafeMap) Set(key interface{}, value interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.