Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
Map is a map safe for asynchronous use. It is just a ordinary map wrapped with a RWMutex.
func NewMap ¶
func NewMap[K comparable, V any]() *Map[K, V]
type SyncMap ¶
type SyncMap[K comparable, V any] struct { // contains filtered or unexported fields }
SyncMap is a map safe for asynchronous use. Typefull wrapper around sync.Map
func (*SyncMap[K, V]) Load ¶
Load returns the value from the sync.Map. If ok=false the zero-value of the value-type is returned as value.
func (*SyncMap[K, V]) LoadOrStore ¶
LoadOrStore saves the value to the sync.Map if it is not already present. Returns the value currently present in the sync.Map. The return value loaded is true if the value has been loaded from the map and not been stored.
Click to show internal directories.
Click to hide internal directories.