Documentation ¶
Index ¶
- type Iterator
- type MutexMap
- func (m *MutexMap[Key, Value]) Clean() map[Key]Value
- func (m *MutexMap[Key, Value]) Delete(k Key)
- func (m *MutexMap[Key, Value]) Len() int
- func (m *MutexMap[Key, Value]) Load(k Key) Value
- func (m *MutexMap[Key, Value]) LoadOk(k Key) (Value, bool)
- func (m *MutexMap[Key, Value]) Range(fn func(key Key, v Value) bool)
- func (m *MutexMap[Key, Value]) Store(k Key, v Value)
- type RCUDeleteNode
- type RCUMap
- func (R *RCUMap[Key, Val]) Delete(key Key)
- func (R *RCUMap[Key, Val]) DeleteMulti(keys []Key) []RCUDeleteNode[Val]
- func (R *RCUMap[Key, Val]) DeleteOk(key Key) (Val, bool)
- func (R *RCUMap[Key, Val]) Len() int
- func (R *RCUMap[Key, Val]) LoadOk(key Key) (Val, bool)
- func (R *RCUMap[Key, Val]) Range(fn func(key Key, val Val) bool)
- func (R *RCUMap[Key, Val]) Store(key Key, val Val)
- func (R *RCUMap[Key, Val]) StoreMulti(kvs []RCUMapElement[Key, Val])
- type RCUMapElement
- type RWMutexMap
- type Slice
- type SliceMap
- func (m *SliceMap[K, V]) Cap() int
- func (m *SliceMap[K, V]) Delete(key K)
- func (m *SliceMap[K, V]) Len() int
- func (m *SliceMap[K, V]) Load(key K) V
- func (m *SliceMap[K, V]) LoadOk(key K) (V, bool)
- func (m *SliceMap[K, V]) Range(fn func(K, V) (next bool))
- func (m *SliceMap[K, V]) Reset()
- func (m *SliceMap[K, V]) Store(key K, value V)
- type SyncMap118
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iterator ¶
type Iterator[Elem any] struct { // contains filtered or unexported fields }
Iterator 是一个迭代器, 它能按照你自己设置的规则返回每一次的数据 它的实现不是goroutine安全的
func NewIterator ¶
type MutexMap ¶
type MutexMap[Key comparable, Value any] struct { // contains filtered or unexported fields }
type RCUDeleteNode ¶
type RCUMap ¶
type RCUMap[Key comparable, Val any] struct { // contains filtered or unexported fields }
RCUMap 这个Map的实现只适合少量key-value, 或者几乎无写的场景 在大量key-value时拷贝数据的开销很大
func NewRCUMap ¶
func NewRCUMap[K comparable, V any]() *RCUMap[K, V]
func (*RCUMap[Key, Val]) DeleteMulti ¶
func (R *RCUMap[Key, Val]) DeleteMulti(keys []Key) []RCUDeleteNode[Val]
func (*RCUMap[Key, Val]) StoreMulti ¶
func (R *RCUMap[Key, Val]) StoreMulti(kvs []RCUMapElement[Key, Val])
type RCUMapElement ¶
type RCUMapElement[Key comparable, Val any] struct { Key Key Value Val }
type RWMutexMap ¶
func (*RWMutexMap[Key, Value]) Delete ¶
func (m *RWMutexMap[Key, Value]) Delete(k Key)
func (*RWMutexMap[Key, Value]) Len ¶
func (m *RWMutexMap[Key, Value]) Len() int
func (*RWMutexMap[Key, Value]) Load ¶
func (m *RWMutexMap[Key, Value]) Load(k Key) Value
func (*RWMutexMap[Key, Value]) LoadOk ¶
func (m *RWMutexMap[Key, Value]) LoadOk(k Key) (Value, bool)
func (*RWMutexMap[Key, Value]) Store ¶
func (m *RWMutexMap[Key, Value]) Store(k Key, v Value)
type Slice ¶
type Slice[V comparable] []V
type SliceMap ¶
type SliceMap[K comparable, V any] struct { // contains filtered or unexported fields }
func NewSliceMap ¶
func NewSliceMap[K comparable, V any](size int) *SliceMap[K, V]
type SyncMap118 ¶
type SyncMap118[Key comparable, Value any] struct { SMap sync.Map // contains filtered or unexported fields }
func (*SyncMap118[Key, Value]) Delete ¶
func (s *SyncMap118[Key, Value]) Delete(k Key)
func (*SyncMap118[Key, Value]) Len ¶
func (s *SyncMap118[Key, Value]) Len() int
func (*SyncMap118[Key, Value]) LoadOk ¶
func (s *SyncMap118[Key, Value]) LoadOk(k Key) (Value, bool)
func (*SyncMap118[Key, Value]) Range ¶
func (s *SyncMap118[Key, Value]) Range(fn func(key Key, value Value) bool)
func (*SyncMap118[Key, Value]) Store ¶
func (s *SyncMap118[Key, Value]) Store(k Key, v Value)
Click to show internal directories.
Click to hide internal directories.