Documentation ¶
Index ¶
- type KeyID
- type SafeMap
- func (s *SafeMap[K, V]) Del(key K)
- func (s *SafeMap[K, V]) Exist(key K) bool
- func (s *SafeMap[K, V]) FromMap(m map[K]V)
- func (s *SafeMap[K, V]) Get(key K) (V, bool)
- func (s *SafeMap[K, V]) GetOrSet(key K, value V) V
- func (s *SafeMap[K, V]) Len() int
- func (s *SafeMap[K, V]) Range(f func(K, V) bool)
- func (s *SafeMap[K, V]) Reset()
- func (s *SafeMap[K, V]) Set(key K, value V)
- func (s *SafeMap[K, V]) ToMap() map[K]V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SafeMap ¶
type SafeMap[K comparable, V any] struct { // contains filtered or unexported fields }
func (*SafeMap[K, V]) FromMap ¶
func (s *SafeMap[K, V]) FromMap(m map[K]V)
FromMap flushes the map and loads the new map.
func (*SafeMap[K, V]) GetOrSet ¶
func (s *SafeMap[K, V]) GetOrSet(key K, value V) V
GetOrSet returns the value for the key if present, otherwise sets and returns the default value
Click to show internal directories.
Click to hide internal directories.