Documentation
¶
Overview ¶
Package loncha/list_head is like a kernel's LIST_HEAD list_head is used by loncha/gen/containers_list
Package skitlistmap is concurrent map implementatin
Index ¶
- Constants
- Variables
- func FindBucketWithLevel(chead *list_head.ListHead, reverse uint64, level int) *bucket
- func FindBucketWithLevel2(chead *list_head.ListHead, reverse uint64, level int) *bucket
- func KeyToHash(key interface{}) (uint64, uint64)
- func MemHash(data []byte) uint64
- func MemHashString(str string) uint64
- func NewEntryMap(key, value interface{}) *entryHMap
- func WithBucket(b *bucket) func(*hmapMethod)
- type CondOfFinder
- type HMapEntry
- type HMethodOpt
- type LevelHead
- type Map
- func (h *Map) ActiveLevels() (result []int)
- func (h *Map) Delete(key interface{})
- func (h *Map) DumpBucket() string
- func (h *Map) DumpBucketPerLevel() string
- func (h *Map) DumpEntry() string
- func (h *Map) Get(key interface{}) (value interface{}, ok bool)
- func (h *Map) GetWithFn(key interface{}, onSuccess func(interface{})) bool
- func (h *Map) LoadItem(key interface{}) (MapItem, bool)
- func (h *Map) MakeBucket(ocur *list_head.ListHead, back int)
- func (h *Map) Options(opts ...OptHMap) (previouses []OptHMap)
- func (h *Map) SearchKey(k uint64, opts ...searchArg) HMapEntry
- func (h *Map) Set(key, value interface{}) bool
- func (h *Map) StoreItem(item MapItem) bool
- type MapHead
- type MapItem
- type OptHMap
- type SampleItem
- func (s *SampleItem) Delete()
- func (s *SampleItem) HmapEntryFromListHead(lhead *list_head.ListHead) HMapEntry
- func (s *SampleItem) Key() interface{}
- func (s *SampleItem) Next() HMapEntry
- func (s *SampleItem) Offset() uintptr
- func (s *SampleItem) Prev() HMapEntry
- func (s *SampleItem) PtrMapHead() *MapHead
- func (s *SampleItem) PtrMapeHead() *MapHead
- func (s *SampleItem) SetValue(v interface{}) bool
- func (s *SampleItem) Value() interface{}
- type SearchMode
Constants ¶
View Source
const ( LenearSearchForBucket SearchMode = 0 ReversSearchForBucket = 1 NestedSearchForBucket = 2 CombineSearch = 3 CombineSearch2 = 4 NoItemSearchForBucket = 9 // test mode FalsesSearchForBucket = 10 )
View Source
const ( CntSearchBucket statKey = 1 CntLevelBucket statKey = 2 CntSearchEntry statKey = 3 CntReverseSearch statKey = 4 CntOfGet statKey = 5 )
Variables ¶
View Source
var DebugStats map[statKey]int = map[statKey]int{}
View Source
var (
EmptyEntryHMap *entryHMap = emptyEntryHMap
)
View Source
var EnableStats bool = false
View Source
var Failreverse uint64 = 0
Functions ¶
func FindBucketWithLevel ¶
func FindBucketWithLevel2 ¶
func MemHashString ¶
func NewEntryMap ¶
func NewEntryMap(key, value interface{}) *entryHMap
func WithBucket ¶
func WithBucket(b *bucket) func(*hmapMethod)
Types ¶
type CondOfFinder ¶
type CondOfFinder func(ehead *entryHMap) bool
func CondOfFind ¶
func CondOfFind(reverse uint64, l sync.Locker) CondOfFinder
type HMethodOpt ¶
type HMethodOpt func(*hmapMethod)
type Map ¶
type Map struct {
ItemFn func() MapItem
// contains filtered or unexported fields
}
Map ... Skip List Map is an ordered and concurrent map. this Map is gourtine safety for reading/updating/deleting, require locking and coordination. This
func (*Map) ActiveLevels ¶
func (*Map) Delete ¶
func (h *Map) Delete(key interface{})
Delete ... set nil to the key of MapItem. cannot Get entry
func (*Map) DumpBucket ¶
func (*Map) DumpBucketPerLevel ¶
type SampleItem ¶
type SampleItem struct {
K interface{}
V interface{}
MapHead
}
var EmptySampleHMapEntry SampleItem = SampleItem{}
func SampleItemFromListHead ¶
func SampleItemFromListHead(head *list_head.ListHead) *SampleItem
func (*SampleItem) Delete ¶
func (s *SampleItem) Delete()
func (*SampleItem) HmapEntryFromListHead ¶
func (s *SampleItem) HmapEntryFromListHead(lhead *list_head.ListHead) HMapEntry
func (*SampleItem) Key ¶
func (s *SampleItem) Key() interface{}
func (*SampleItem) Next ¶
func (s *SampleItem) Next() HMapEntry
func (*SampleItem) Offset ¶
func (s *SampleItem) Offset() uintptr
func (*SampleItem) Prev ¶
func (s *SampleItem) Prev() HMapEntry
func (*SampleItem) PtrMapHead ¶
func (s *SampleItem) PtrMapHead() *MapHead
func (*SampleItem) PtrMapeHead ¶
func (s *SampleItem) PtrMapeHead() *MapHead
func (*SampleItem) SetValue ¶
func (s *SampleItem) SetValue(v interface{}) bool
func (*SampleItem) Value ¶
func (s *SampleItem) Value() interface{}
type SearchMode ¶
type SearchMode byte
Click to show internal directories.
Click to hide internal directories.