Documentation
¶
Index ¶
- type Group
- type Map
- func (m *Map[K, V]) Clear()
- func (m *Map[K, V]) CompareAndDelete(key K, old V) bool
- func (m *Map[K, V]) CompareAndSwap(key K, old, new V) bool
- func (m *Map[K, V]) Delete(key K)
- func (m *Map[K, V]) Load(key K) (V, bool)
- func (m *Map[K, V]) LoadAndDelete(key K) (V, bool)
- func (m *Map[K, V]) LoadOrStore(key K, value V) (V, bool)
- func (m *Map[K, V]) Range(f func(key K, value V) bool)
- func (m *Map[K, V]) Store(key K, value V)
- func (m *Map[K, V]) Swap(key K, value V) (V, bool)
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
Group represents a class of work and forms a namespace in which units of work can be executed with duplicate suppression.
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
func (*Map[K, V]) CompareAndDelete ¶
CompareAndDelete deletes the entry for key if its value is equal to old. Note: Like sync.Map, this requires V's dynamic type to be comparable; otherwise it will panic.
func (*Map[K, V]) CompareAndSwap ¶
CompareAndSwap compares the existing value for key with old and, if they are equal, replaces it with newVal. Note: Like sync.Map, this requires V's dynamic type to be comparable; otherwise it will panic.
func (*Map[K, V]) LoadAndDelete ¶
func (*Map[K, V]) LoadOrStore ¶
Click to show internal directories.
Click to hide internal directories.