Documentation
¶
Index ¶
- type SyncMap
- func (s *SyncMap[K, V]) Delete(key K)
- func (s *SyncMap[K, V]) Has(key K) bool
- func (s *SyncMap[K, V]) Len() int
- func (s *SyncMap[K, V]) Load(key K) (V, bool)
- func (s *SyncMap[K, V]) Range(callback func(key K, value V) bool)
- func (s *SyncMap[K, V]) Store(key K, value V)
- func (s *SyncMap[K, V]) ToMap() map[K]V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SyncMap ¶
type SyncMap[K comparable, V any] struct { // contains filtered or unexported fields }
SyncMap is a thread-safe map.
func NewSyncMap ¶
func NewSyncMap[K comparable, V any](n int) *SyncMap[K, V]
NewSyncMap creates a new SyncMap.
func (*SyncMap[K, V]) Delete ¶
func (s *SyncMap[K, V]) Delete(key K)
Delete deletes a value from the map.
Click to show internal directories.
Click to hide internal directories.