Documentation ¶
Overview ¶
Package tsmap provides a collection of thread-safe map functions that can be safely used between multiple goroutines.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get[K comparable, V any](mux threadsafe.RLocker, m map[K]V, key K) V
Get is a thread-safe function to get a value by key in a map.
func Len ¶
func Len[K comparable, V any](mux threadsafe.RLocker, m map[K]V) int
Len is a thread-safe function to get the length of a map.
func Set ¶
func Set[K comparable, V any](mux threadsafe.Locker, m map[K]V, key K, value V)
Set is a thread-safe function to assign a value to a key in a map.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.