Documentation
¶
Index ¶
- type SafeMap
- func (s *SafeMap[K, V]) Add(key K, value V)
- func (s *SafeMap[K, V]) Delete(key K)
- func (s *SafeMap[K, V]) Get(key K) V
- func (s *SafeMap[K, V]) GetWithLookup(key K) (V, bool)
- func (s *SafeMap[K, V]) Has(key K) bool
- func (s *SafeMap[K, V]) Keys() []K
- func (s *SafeMap[K, V]) Len() int
- func (s *SafeMap[K, V]) Values() []V
- type SafeSet
- type Set
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 }
SafeMap is a thread-safe wrapper around a Map.
func (*SafeMap[K, V]) Add ¶
func (s *SafeMap[K, V]) Add(key K, value V)
Add inserts an key with value into the map.
func (*SafeMap[K, V]) Delete ¶
func (s *SafeMap[K, V]) Delete(key K)
Delete removes an key from the map.
func (*SafeMap[K, V]) Get ¶
func (s *SafeMap[K, V]) Get(key K) V
Get return an value with key from the map.
func (*SafeMap[K, V]) GetWithLookup ¶
GetWithLookup return an value and do lookup from the map.
func (*SafeMap[K, V]) Keys ¶
func (s *SafeMap[K, V]) Keys() []K
Items returns all keys in the map as slices.
type SafeSet ¶
type SafeSet[T comparable] struct { // contains filtered or unexported fields }
SafeSet is a thread-safe wrapper around a Set.
func (*SafeSet[T]) Delete ¶
func (s *SafeSet[T]) Delete(item T)
Delete removes an item from the set.
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
Set is a basic non-thread-safe generic set.
Click to show internal directories.
Click to hide internal directories.