Documentation ¶
Index ¶
- func SortedKeys[M ~map[K]V, K constraints.Ordered, V any](m M) []K
- type Sync
- func (s *Sync[K, V]) CompareAndDelete(k K, old V) bool
- func (s *Sync[K, V]) CompareAndSwap(k K, old, new V) bool
- func (s *Sync[K, V]) Delete(k K)
- func (s *Sync[K, V]) Load(k K) (V, bool)
- func (s *Sync[K, V]) LoadAndDelete(k K) (V, bool)
- func (s *Sync[K, V]) LoadOrStore(k K, store V) (V, bool)
- func (s *Sync[K, V]) Range(f func(k K, v V) bool)
- func (s *Sync[K, V]) Store(k K, v V)
- func (s *Sync[K, V]) Swap(k K, v V) (V, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortedKeys ¶
func SortedKeys[M ~map[K]V, K constraints.Ordered, V any](m M) []K
Types ¶
type Sync ¶
type Sync[K, V any] struct { // contains filtered or unexported fields }
Sync is a simple wrapper around sync.Map that provides type-safe methods
func (*Sync[K, V]) CompareAndDelete ¶
func (*Sync[K, V]) CompareAndSwap ¶
func (*Sync[K, V]) LoadAndDelete ¶
func (*Sync[K, V]) LoadOrStore ¶
Click to show internal directories.
Click to hide internal directories.