Documentation
¶
Overview ¶
implentation of a safe concurrent generic map
Index ¶
- type AsyncMap
- func (s *AsyncMap[K, V]) Clear()
- func (s *AsyncMap[K, V]) Contains(key K) bool
- func (s *AsyncMap[K, V]) Delete(key K)
- func (s *AsyncMap[K, V]) Get(key K) (V, bool)
- func (s *AsyncMap[K, V]) IsEmpty() bool
- func (s *AsyncMap[K, V]) Keys() []K
- func (s *AsyncMap[K, V]) Len() int
- func (s *AsyncMap[K, V]) Set(key K, value V)
- func (s *AsyncMap[K, V]) Values() []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncMap ¶
type AsyncMap[K comparable, V any] struct { // contains filtered or unexported fields }
AsyncMap is a generic implementation of a safe map. K is the key and V is the value.
Supports multiple concurrent reads and writes with the sync.RWMutex
func NewAsyncMap ¶
func NewAsyncMap[K comparable, V any]() *AsyncMap[K, V]
Instantiates a new AsyncMap.
func (*AsyncMap[K, V]) Delete ¶
func (s *AsyncMap[K, V]) Delete(key K)
deletes the element with the specified key
func (*AsyncMap[K, V]) Keys ¶
func (s *AsyncMap[K, V]) Keys() []K
Returns a slice of the keys in the map
Click to show internal directories.
Click to hide internal directories.