Documentation ¶
Overview ¶
A thread safe map implementation for Golang
Index ¶
- type Item
- type SyncMap
- func (m *SyncMap) Delete(key string)
- func (m *SyncMap) Flush() int
- func (m *SyncMap) Get(key string) (value interface{}, ok bool)
- func (m *SyncMap) Has(key string) bool
- func (m *SyncMap) IterItems() <-chan Item
- func (m *SyncMap) IterKeys() <-chan string
- func (m *SyncMap) Pop() (string, interface{})
- func (m *SyncMap) Set(key string, value interface{})
- func (m *SyncMap) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SyncMap ¶
type SyncMap struct {
// contains filtered or unexported fields
}
SyncMap keeps a slice of *syncMap with length of `shardCount`. Using a slice of syncMap instead of a large one is to avoid lock bottlenecks.
func NewWithShard ¶
Create a new SyncMap with given shard count. NOTE: shard count must be power of 2, default shard count will be used otherwise.
func (*SyncMap) IterItems ¶
Return a channel from which each item (key:value pair) in the map can be read
Click to show internal directories.
Click to hide internal directories.