Documentation
¶
Overview ¶
Package syncx provides synchronized concurrent-safe data structures.
Index ¶
- type Map
- func (m *Map[K, V]) Delete(key K)
- func (m *Map[K, V]) Get(key K) (value V, ok bool)
- func (m *Map[K, V]) Iterate(f func(key K, value V))
- func (m *Map[K, V]) LoadAndDelete(key K) (value V, loaded bool)
- func (m *Map[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
- func (m *Map[K, V]) Set(key K, value V)
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 }
func (*Map[K, V]) LoadAndDelete ¶ added in v0.92.0
LoadAndDelete atomically retrieves and removes the value for the given key. It returns the value (if loaded) and whether it was loaded.
func (*Map[K, V]) LoadOrStore ¶ added in v0.93.0
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored.
Click to show internal directories.
Click to hide internal directories.