package
Version:
v0.750.9-dryrun
Opens a new window with list of versions in this module.
Published: Aug 22, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
type Map
-
func (m *Map[K, V]) Clear()
-
func (m *Map[K, V]) Delete(k K) (V, bool)
-
func (m *Map[K, V]) Len() int
-
func (m *Map[K, V]) Load(k K) (V, bool)
-
func (m *Map[K, V]) Store(k K, v V)
-
func (m *Map[K, V]) Values() []V
-
func (m *Map[K, V]) WithLock(f func(m map[K]V))
Map is a generic, thread-safe map to supersede usages of sync.Map.
New creates an empty map.
func (m *Map[K, V]) Clear()
Clear the map.
func (m *Map[K, V]) Delete(k K) (V, bool)
Delete the value corresponding to k, idempotently.
Len of the map (number of stored pairs).
func (m *Map[K, V]) Load(k K) (V, bool)
Load the value corresponding to k.
func (m *Map[K, V]) Store(k K, v V)
Store the (k,v) pair.
func (m *Map[K, V]) Values() []V
Values returns the list of values in the map.
func (m *Map[K, V]) WithLock(f func(m map[K]V))
WithLock runs the given function on the underlying map with a write lock.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.