Documentation ¶
Index ¶
- type LinkedMap
- func (lm *LinkedMap[K, V]) Delete(k K) (V, bool)
- func (lm *LinkedMap[K, V]) Keys() []K
- func (lm *LinkedMap[K, V]) Len() int
- func (lm *LinkedMap[K, V]) Load(k K) (V, bool)
- func (lm *LinkedMap[K, V]) LoadOrStore(k K, v V) (V, bool)
- func (lm *LinkedMap[K, V]) Oldest() (V, bool)
- func (lm *LinkedMap[K, V]) Range(fn LinkedMapRanger[K, V])
- func (lm *LinkedMap[K, V]) Store(k K, v V)
- type LinkedMapRanger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinkedMap ¶
type LinkedMap[K comparable, V any] struct { // contains filtered or unexported fields }
func New ¶
func New[K comparable, V any]() *LinkedMap[K, V]
func (*LinkedMap[K, V]) LoadOrStore ¶
若 key 的键值存在,返回 (原始键值, false) 否则,键值设置为 v,返回 (v, true)
func (*LinkedMap[K, V]) Range ¶
func (lm *LinkedMap[K, V]) Range(fn LinkedMapRanger[K, V])
按插入时间倒序遍历
type LinkedMapRanger ¶
type LinkedMapRanger[K comparable, V any] func(k K, v V) bool
Click to show internal directories.
Click to hide internal directories.