Documentation ¶
Index ¶
- type Array
- type DLinkOption
- type FnErrLink
- type FnErrLink1
- type FnErrLink2
- type FnErrLink3
- type FnErrLink4
- type FnErrLink5
- type FnErrLink6
- type FnLink
- type FnLink1
- type FnLink2
- type FnLink3
- type FnLink4
- type FnLink5
- type FnLink6
- type IdLink
- type KSet
- func (s *KSet[KT, VT]) Add(item VT) *util.Err
- func (s *KSet[KT, VT]) AddNX(item VT) bool
- func (s *KSet[KT, VT]) AddNX2(key KT, new func() VT) bool
- func (s *KSet[KT, VT]) Any(fn func(VT) bool) bool
- func (s *KSet[KT, VT]) Cap() int
- func (s *KSet[KT, VT]) CopyKeys(keys *[]KT)
- func (s *KSet[KT, VT]) CopyValues(values *[]VT)
- func (s *KSet[KT, VT]) Count() int
- func (s *KSet[KT, VT]) Del(k KT) (val VT, exist bool)
- func (s *KSet[KT, VT]) Get(key KT) (VT, bool)
- func (s *KSet[KT, VT]) GetOrNew(key KT, new func() VT) (VT, bool)
- func (s *KSet[KT, VT]) GetWithIdx(idx int) (VT, bool)
- func (s *KSet[KT, VT]) Has(key KT) bool
- func (s *KSet[KT, VT]) Iter(fn func(VT))
- func (s *KSet[KT, VT]) ReplaceOrNew(oldKey KT, newItem VT) bool
- func (s *KSet[KT, VT]) Reset()
- func (s *KSet[KT, VT]) Set(item VT) (old VT)
- func (s *KSet[KT, VT]) TestDel(test func(KT, VT) (del bool, brk bool))
- func (s *KSet[KT, VT]) Values() []VT
- type KSet2
- type Link
- func (l *Link[T]) Any(fn func(T) bool) bool
- func (l *Link[T]) Copy(lnk *Link[T])
- func (l *Link[T]) Count() uint32
- func (l *Link[T]) Del(fn func(T) bool) bool
- func (l *Link[T]) Dispose()
- func (l *Link[T]) Head() (T, bool)
- func (l *Link[T]) Insert(a T, fn func(T) bool)
- func (l *Link[T]) Iter(fn func(T))
- func (l *Link[T]) Pop() (T, bool)
- func (l *Link[T]) PopAll() *LinkElem[T]
- func (l *Link[T]) Push(a T)
- func (l *Link[T]) PushLink(lnk *Link[T])
- func (l *Link[T]) Tail() (T, bool)
- func (l *Link[T]) Values(values *[]T) bool
- type Link2
- type LinkElem
- type List
- type RBTree
- func (t *RBTree[KT, VT]) AnyAsc(fn func(KT, VT) bool) bool
- func (t *RBTree[KT, VT]) AnyAscFrom(k KT, fn func(KT, VT) bool) (match bool, ok bool)
- func (t *RBTree[KT, VT]) AnyDesc(fn func(KT, VT) bool) bool
- func (t *RBTree[KT, VT]) AnyDescFrom(k KT, fn func(KT, VT) bool) (match bool, ok bool)
- func (t *RBTree[KT, VT]) Del(key KT) (value VT)
- func (t *RBTree[KT, VT]) Get(k KT) (VT, bool)
- func (t *RBTree[KT, VT]) M() map[KT]VT
- func (t *RBTree[KT, VT]) Reset()
- func (t *RBTree[KT, VT]) Set(k KT, v VT)
- func (t *RBTree[KT, VT]) Update(m map[KT]VT)
- type RBTreeNode
- type Ring
- func (r *Ring[T]) Available() uint32
- func (r *Ring[T]) Iter(fn func([]T))
- func (r *Ring[T]) IterAll(fn func(T))
- func (r *Ring[T]) Pop() (item T, err *util.Err)
- func (r *Ring[T]) Put(items ...T) *util.Err
- func (r *Ring[T]) Read(s []T, l uint32) *util.Err
- func (r *Ring[T]) ReadMax(s []T) uint32
- func (r *Ring[T]) Reset()
- type RingOption
- type Set2Item
- type SetItem
- type SetLink
- func (l *SetLink[KT, VT]) Any(fn func(VT) bool) bool
- func (l *SetLink[KT, VT]) Count() int
- func (l *SetLink[KT, VT]) Del(test func(VT) bool) (VT, bool)
- func (l *SetLink[KT, VT]) Get(key KT) (VT, bool)
- func (l *SetLink[KT, VT]) Iter(fn func(VT))
- func (l *SetLink[KT, VT]) NewOrUpdate(key KT, update func(VT), new func() VT) (exist bool)
- func (l *SetLink[KT, VT]) Pop() (VT, bool)
- func (l *SetLink[KT, VT]) Push(val VT) bool
- func (l *SetLink[KT, VT]) Remove(val VT)
- func (l *SetLink[KT, VT]) RemoveByKey(key KT)
- func (l *SetLink[KT, VT]) Values() []VT
- type SetLinkElem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array[T comparable] struct { // contains filtered or unexported fields }
Array 无序数组
func NewArray ¶
func NewArray[T comparable](defCap int) *Array[T]
type DLinkOption ¶
type DLinkOption[KT comparable, VT any] func(o *setLinkOption[KT, VT])
func SetLinkRecycleElem ¶
func SetLinkRecycleElem[KT comparable, VT any](recycle func(*SetLinkElem[VT])) DLinkOption[KT, VT]
func SetLinkSpawnElem ¶
func SetLinkSpawnElem[KT comparable, VT any](spawn func() *SetLinkElem[VT]) DLinkOption[KT, VT]
func SetLinkValToKey ¶
func SetLinkValToKey[KT comparable, VT any](valToKey func(VT) KT) DLinkOption[KT, VT]
type FnErrLink ¶
func NewFnErrLink ¶
func NewFnErrLink() *FnErrLink
type FnErrLink1 ¶
func NewFnErrLink1 ¶
func NewFnErrLink1[T any]() *FnErrLink1[T]
func (*FnErrLink1[T]) Del ¶
func (l *FnErrLink1[T]) Del(fn func(T) *util.Err)
func (*FnErrLink1[T]) Invoke ¶
func (l *FnErrLink1[T]) Invoke(obj T) *util.Err
func (*FnErrLink1[T]) Reset ¶
func (l *FnErrLink1[T]) Reset()
type FnErrLink2 ¶
func NewFnErrLink2 ¶
func NewFnErrLink2[T0, T1 any]() *FnErrLink2[T0, T1]
func (*FnErrLink2[T0, T1]) Del ¶
func (l *FnErrLink2[T0, T1]) Del(fn func(T0, T1) *util.Err)
func (*FnErrLink2[T0, T1]) Invoke ¶
func (l *FnErrLink2[T0, T1]) Invoke(v0 T0, v1 T1) *util.Err
func (*FnErrLink2[T0, T1]) Reset ¶
func (l *FnErrLink2[T0, T1]) Reset()
type FnErrLink3 ¶
func NewFnErrLink3 ¶
func NewFnErrLink3[T0, T1, T2 any]() *FnErrLink3[T0, T1, T2]
func (*FnErrLink3[T0, T1, T2]) Del ¶
func (l *FnErrLink3[T0, T1, T2]) Del(fn func(T0, T1, T2) *util.Err)
func (*FnErrLink3[T0, T1, T2]) Invoke ¶
func (l *FnErrLink3[T0, T1, T2]) Invoke(v0 T0, v1 T1, v2 T2) *util.Err
func (*FnErrLink3[T0, T1, T2]) Reset ¶
func (l *FnErrLink3[T0, T1, T2]) Reset()
type FnErrLink4 ¶
func NewFnErrLink4 ¶
func NewFnErrLink4[T0, T1, T2, T3 any]() *FnErrLink4[T0, T1, T2, T3]
func (*FnErrLink4[T0, T1, T2, T3]) Del ¶
func (l *FnErrLink4[T0, T1, T2, T3]) Del(fn func(T0, T1, T2, T3) *util.Err)
func (*FnErrLink4[T0, T1, T2, T3]) Invoke ¶
func (l *FnErrLink4[T0, T1, T2, T3]) Invoke(v0 T0, v1 T1, v2 T2, v3 T3) *util.Err
func (*FnErrLink4[T0, T1, T2, T3]) Reset ¶
func (l *FnErrLink4[T0, T1, T2, T3]) Reset()
type FnErrLink5 ¶
func NewFnErrLink5 ¶
func NewFnErrLink5[T0, T1, T2, T3, T4 any]() *FnErrLink5[T0, T1, T2, T3, T4]
func (*FnErrLink5[T0, T1, T2, T3, T4]) Del ¶
func (l *FnErrLink5[T0, T1, T2, T3, T4]) Del(fn func(T0, T1, T2, T3, T4) *util.Err)
func (*FnErrLink5[T0, T1, T2, T3, T4]) Invoke ¶
func (l *FnErrLink5[T0, T1, T2, T3, T4]) Invoke(v0 T0, v1 T1, v2 T2, v3 T3, v4 T4) *util.Err
func (*FnErrLink5[T0, T1, T2, T3, T4]) Reset ¶
func (l *FnErrLink5[T0, T1, T2, T3, T4]) Reset()
type FnErrLink6 ¶
type FnErrLink6[T0, T1, T2, T3, T4, T5 any] struct { *Link[func(T0, T1, T2, T3, T4, T5) *util.Err] }
func NewFnErrLink6 ¶
func NewFnErrLink6[T0, T1, T2, T3, T4, T5 any]() *FnErrLink6[T0, T1, T2, T3, T4, T5]
func (*FnErrLink6[T0, T1, T2, T3, T4, T5]) Del ¶
func (l *FnErrLink6[T0, T1, T2, T3, T4, T5]) Del(fn func(T0, T1, T2, T3, T4, T5) *util.Err)
func (*FnErrLink6[T0, T1, T2, T3, T4, T5]) Invoke ¶
func (l *FnErrLink6[T0, T1, T2, T3, T4, T5]) Invoke(v0 T0, v1 T1, v2 T2, v3 T3, v4 T4, v5 T5) *util.Err
func (*FnErrLink6[T0, T1, T2, T3, T4, T5]) Reset ¶
func (l *FnErrLink6[T0, T1, T2, T3, T4, T5]) Reset()
type FnLink ¶
func (*FnLink) InvokeAndReset ¶
type FnLink1 ¶
func NewFnLink1 ¶
type FnLink2 ¶
func NewFnLink2 ¶
type FnLink3 ¶
func NewFnLink3 ¶
type FnLink4 ¶
func NewFnLink4 ¶
func (*FnLink4[T0, T1, T2, T3]) Del ¶
func (l *FnLink4[T0, T1, T2, T3]) Del(fn func(T0, T1, T2, T3))
type FnLink5 ¶
func NewFnLink5 ¶
func (*FnLink5[T0, T1, T2, T3, T4]) Del ¶
func (l *FnLink5[T0, T1, T2, T3, T4]) Del(fn func(T0, T1, T2, T3, T4))
type FnLink6 ¶
func NewFnLink6 ¶
func (*FnLink6[T0, T1, T2, T3, T4, T5]) Del ¶
func (l *FnLink6[T0, T1, T2, T3, T4, T5]) Del(fn func(T0, T1, T2, T3, T4, T5))
type IdLink ¶
type IdLink[KT comparable, VT any] struct { Link[VT] // contains filtered or unexported fields }
func NewIdLink ¶
func NewIdLink[KT comparable, VT any]() *IdLink[KT, VT]
type KSet ¶
type KSet[KT comparable, VT any] struct { // contains filtered or unexported fields }
func (*KSet[KT, VT]) CopyValues ¶
func (s *KSet[KT, VT]) CopyValues(values *[]VT)
func (*KSet[KT, VT]) GetWithIdx ¶
func (*KSet[KT, VT]) ReplaceOrNew ¶
type KSet2 ¶
type KSet2[KT1, KT2 comparable, VT any] struct { *KSet[KT1, *Set2Item[KT1, KT2, VT]] // contains filtered or unexported fields }
func NewKSet2 ¶
func NewKSet2[KT1, KT2 comparable, VT any](defCap int, getKey func(VT) KT2) *KSet2[KT1, KT2, VT]
func (*KSet2[KT1, KT2, VT]) ReplaceKey ¶
type Link2 ¶
type Link2[T comparable] struct { // contains filtered or unexported fields }
func NewLink2 ¶
func NewLink2[T comparable]() *Link2[T]
func (*Link2[T]) IterAndReset ¶
func (l *Link2[T]) IterAndReset(fn func([]T))
type List ¶
type List[T comparable] struct { // contains filtered or unexported fields }
List 有序数组
func NewList ¶
func NewList[T comparable](defCap int) *List[T]
type RBTree ¶
type RBTree[KT comparable, VT any] struct { // contains filtered or unexported fields }
func NewRBTreeFromM ¶
func NewRBTreeFromM[KT comparable, VT any](m map[KT]VT, compare util.Compare[KT]) *RBTree[KT, VT]
func (*RBTree[KT, VT]) AnyAscFrom ¶
func (*RBTree[KT, VT]) AnyDescFrom ¶
type RBTreeNode ¶
type RBTreeNode[KT comparable, VT any] struct { Key KT Value VT // contains filtered or unexported fields }
type RingOption ¶
type RingOption[T any] func(o *ringOption[T])
func RingMaxCap ¶
func RingMinCap ¶
func RingResize ¶
type Set2Item ¶
type Set2Item[KT1, KT2 comparable, VT any] struct { *KSet[KT2, VT] // contains filtered or unexported fields }
func NewSet2Item ¶
func NewSet2Item[KT1, KT2 comparable, VT any](key KT1, defCap int, getKey func(VT) KT2) *Set2Item[KT1, KT2, VT]
type SetItem ¶
type SetItem[KT comparable, VT any] struct { *KSet[KT, VT] // contains filtered or unexported fields }
func NewSetItem ¶
func NewSetItem[KT comparable, VT any](defCap int, key KT, getKey func(VT) KT) *SetItem[KT, VT]
type SetLink ¶
type SetLink[KT comparable, VT any] struct { // contains filtered or unexported fields }
SetLink 元素唯一双向链表
func NewSetLink ¶
func NewSetLink[KT comparable, VT any](cap int, opts ...DLinkOption[KT, VT]) *SetLink[KT, VT]
func (*SetLink[KT, VT]) NewOrUpdate ¶
func (*SetLink[KT, VT]) RemoveByKey ¶
func (l *SetLink[KT, VT]) RemoveByKey(key KT)
type SetLinkElem ¶
type SetLinkElem[T any] struct { Value T // contains filtered or unexported fields }
func (*SetLinkElem[T]) Dispose ¶
func (n *SetLinkElem[T]) Dispose()
Click to show internal directories.
Click to hide internal directories.