Documentation
¶
Index ¶
- type ConcurrentMap
- func (m *ConcurrentMap) Clear()
- func (m *ConcurrentMap) Count() int
- func (m *ConcurrentMap) Get(key string) (interface{}, bool)
- func (m *ConcurrentMap) Has(key string) bool
- func (m *ConcurrentMap) IterCb(fn IterCb)
- func (m *ConcurrentMap) Keys() []string
- func (m *ConcurrentMap) Remove(key string) (interface{}, bool)
- func (m *ConcurrentMap) Set(key string, value interface{})
- func (m *ConcurrentMap) SetIfAbsent(key string, value interface{}) bool
- type IterCb
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcurrentMap ¶
type ConcurrentMap struct {
// contains filtered or unexported fields
}
ConcurrentMap is a thread safe map of type string:Anything. To avoid lock bottlenecks this map is divided to several map chunks.
func NewConcurrentMap ¶
func NewConcurrentMap(nChunks uint32) *ConcurrentMap
NewConcurrentMap creates a new concurrent map.
func (*ConcurrentMap) Count ¶
func (m *ConcurrentMap) Count() int
Count returns the number of elements within the map
func (*ConcurrentMap) Get ¶
func (m *ConcurrentMap) Get(key string) (interface{}, bool)
Get retrieves an element from map under given key.
func (*ConcurrentMap) Has ¶
func (m *ConcurrentMap) Has(key string) bool
Has looks up an item under specified key.
func (*ConcurrentMap) IterCb ¶
func (m *ConcurrentMap) IterCb(fn IterCb)
IterCb iterates over the map (cheapest way to read all elements in a map)
func (*ConcurrentMap) Keys ¶
func (m *ConcurrentMap) Keys() []string
Keys returns all keys as []string
func (*ConcurrentMap) Remove ¶
func (m *ConcurrentMap) Remove(key string) (interface{}, bool)
Remove removes an element from the map.
func (*ConcurrentMap) Set ¶
func (m *ConcurrentMap) Set(key string, value interface{})
Set sets the given value under the specified key.
func (*ConcurrentMap) SetIfAbsent ¶
func (m *ConcurrentMap) SetIfAbsent(key string, value interface{}) bool
SetIfAbsent sets the given value under the specified key if no value was associated with it.
Click to show internal directories.
Click to hide internal directories.