package
module
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Mar 24, 2022
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 4
Opens a new window with list of known importers.
Documentation
¶
syncmap implements a generic synchronized map ontop of sync.Map.
-
type Map
-
func (m *Map[K, V]) Delete(I K)
-
func (m *Map[K, V]) Load(I K) (V, bool)
-
func (m *Map[K, V]) LoadAndDelete(I K) (V, bool)
-
func (m *Map[K, V]) LoadOrStore(I K, J V) (V, bool)
-
func (m *Map[K, V]) Range(L func(I K, J V) bool)
-
func (m *Map[K, V]) Store(I K, J V)
type Map[K any, V any] struct {
}
Map is a sync.Map wrapped in a generic manner.
New returns a new Map that is generic.
func (m *Map[K, V]) Delete(I K)
Delete will delete data from the Map.
func (m *Map[K, V]) Load(I K) (V, bool)
Load will load data from the Map.
func (m *Map[K, V]) LoadAndDelete(I K) (V, bool)
LoadAndDelete will load and delete data from the Map.
func (m *Map[K, V]) LoadOrStore(I K, J V) (V, bool)
LoadOrStore will load or store data from the Map.
func (m *Map[K, V]) Range(L func(I K, J V) bool)
Range will iterate over the data in the Map and apply the func on it.
func (m *Map[K, V]) Store(I K, J V)
Store will store data in the Map.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.