intmap package - github.com/kelindar/intmap - Go Packages
- type Map
- func (m *Map) Capacity() int
- func (m *Map) Clear()
- func (m *Map) Clone() *Map
- func (m *Map) Count() int
- func (m *Map) Delete(key uint32)
- func (m *Map) Load(key uint32) (uint32, bool)
- func (m *Map) Range(fn func(key, val uint32) bool)
- func (m *Map) RangeEach(fn func(key, val uint32))
- func (m *Map) RangeErr(fn func(key, val uint32) error) error
- func (m *Map) Store(key, val uint32)
- type Sync
- func (m *Sync) Count() (count int)
- func (m *Sync) Delete(key uint32)
- func (m *Sync) Load(key uint32) (value uint32, ok bool)
- func (m *Sync) LoadOrStore(key uint32, fn func() uint32) (value uint32, loaded bool)
- func (m *Sync) Range(f func(key, value uint32) bool)
- func (m *Sync) Store(key, val uint32)
This section is empty.
This section is empty.
This section is empty.
Map is a contiguous hash table with interleaved key/value slots.
New allocates a map sized for at least `size` entries.
New allocates a map sized for at least `size` entries.
Clear removes all key/value pairs from the map.
Delete removes the value for a key.
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
Range visits every key/value pair in the map.
RangeEach visits every key/value pair without early‑exit capability.
RangeErr stops on the first error returned by fn and propagates it.
Sync is a thread-safe, map-like data-structure for int64s
NewSync returns a thread-safe map initialized with n spaces and uses the stated fillFactor. The map will grow as needed.
NewSyncWithFill returns a thread-safe map initialized with n spaces and uses the stated fillFactor. The map will grow as needed.
Delete deletes the value for a key.
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value returned by the handler. The loaded result is true if the value was loaded, false if stored.
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.