Documentation
¶
Index ¶
- type CMap
- func (c *CMap[K, V]) Delete(key K)
- func (c *CMap[K, V]) Iter() (rv chan Pair[K, V])
- func (c *CMap[K, V]) Keys() []K
- func (c *CMap[K, V]) Len() int
- func (c *CMap[K, V]) Load(key K) (value V, ok bool)
- func (c *CMap[K, V]) LoadAndDelete(key K) (value V, loaded bool)
- func (c *CMap[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
- func (c *CMap[K, V]) Range(f func(key K, value V) bool)
- func (c *CMap[K, V]) Store(key K, value V)
- func (c *CMap[K, V]) UpdateOrInsert(k K, cb UpdataOrInsertCb[K, V])
- func (c *CMap[K, V]) Values() []V
- type Item
- type Pair
- type UpdataOrInsertCb
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CMap ¶
type CMap[K constraints.Ordered, V any] struct { // contains filtered or unexported fields }
func (*CMap[K, V]) LoadAndDelete ¶
func (*CMap[K, V]) LoadOrStore ¶
func (*CMap[K, V]) UpdateOrInsert ¶ added in v0.0.9
func (c *CMap[K, V]) UpdateOrInsert(k K, cb UpdataOrInsertCb[K, V])
删除或者更新
type Item ¶
type Item[K constraints.Ordered, V any] struct { // contains filtered or unexported fields }
type Pair ¶
type Pair[K constraints.Ordered, V any] struct { Key K Val V }
type UpdataOrInsertCb ¶ added in v0.0.9
type UpdataOrInsertCb[K constraints.Ordered, V any] func(exist bool, old V) (newVal V)
Click to show internal directories.
Click to hide internal directories.