Documentation
¶
Index ¶
- type Map
- func (m *Map[V]) Delete(key string) bool
- func (m *Map[V]) Len() int
- func (m *Map[V]) Load(key string) (value V, ok bool)
- func (m *Map[V]) LoadAndDelete(key string) (value V, loaded bool)
- func (m *Map[V]) LoadOrStore(key string, value V) (actual V, loaded bool)
- func (m *Map[V]) LoadOrStoreLazy(key string, lazy func() V) (actual V, loaded bool)
- func (m *Map[V]) Range(f func(key string, value V) bool)
- func (m *Map[V]) Store(key string, value V)
- type SyncStringMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[V any] struct { // contains filtered or unexported fields }
Map a wrapper for sync.Map to support generic
func (*Map[V]) LoadAndDelete ¶
func (*Map[V]) LoadOrStore ¶
func (*Map[V]) LoadOrStoreLazy ¶
type SyncStringMap ¶
type SyncStringMap[V any] interface { Delete(key string) bool Load(key string) (value V, ok bool) LoadAndDelete(key string) (value V, loaded bool) LoadOrStore(key string, value V) (actual V, loaded bool) LoadOrStoreLazy(key string, lazy func() V) (actual V, loaded bool) Range(f func(key string, value V) bool) Store(key string, value V) Len() int }
func New ¶
func New[V any]() SyncStringMap[V]
Click to show internal directories.
Click to hide internal directories.