Documentation ¶
Index ¶
- Constants
- type Iterator
- type Queue
- func (cache *Queue) CreateSkipValue(item Scorer) *SkipValue
- func (cache *Queue) Exist(hash string) bool
- func (cache *Queue) First() Scorer
- func (cache *Queue) GetCacheBytes() int64
- func (cache *Queue) GetItem(hash string) (Scorer, error)
- func (cache *Queue) Insert(hash string, item Scorer)
- func (cache *Queue) Last() Scorer
- func (cache *Queue) MaxSize() int64
- func (cache *Queue) Push(item Scorer) error
- func (cache *Queue) Remove(hash string) error
- func (cache *Queue) Size() int
- func (cache *Queue) Walk(count int, cb func(value Scorer) bool)
- type Scorer
- type SkipList
- func (sl *SkipList) Delete(value *SkipValue) int
- func (sl *SkipList) Find(value *SkipValue) *SkipValue
- func (sl *SkipList) FindCount() int
- func (sl *SkipList) FindGreaterOrEqual(value *SkipValue) *SkipValue
- func (sl *SkipList) GetIterator() *Iterator
- func (sl *SkipList) Insert(value *SkipValue) int
- func (sl *SkipList) Len() int
- func (sl *SkipList) Level() int
- func (sl *SkipList) Print()
- func (sl *SkipList) Walk(cb func(value interface{}) bool)
- func (sl *SkipList) WalkS(cb func(value interface{}) bool)
- type SkipValue
Constants ¶
View Source
const ( Big = -1 Small = 1 Equal = 0 )
Compare Const
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator 跳跃表迭代器
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue skiplist 实现的一个 按照score 排序的队列,score相同的按照元素到的先后排序
func (*Queue) CreateSkipValue ¶
CreateSkipValue 创建一个 仅仅有 score 的Value
func (*Queue) GetCacheBytes ¶
GetCacheBytes get cache byte size
type Scorer ¶
type Scorer interface { GetScore() int64 Hash() []byte //在score相同情况下的比较 Compare(Scorer) int //占用字节大小 ByteSize() int64 }
Scorer 接口实现 Value的 Score 功能
type SkipList ¶
type SkipList struct {
// contains filtered or unexported fields
}
SkipList 跳跃表
func (*SkipList) FindGreaterOrEqual ¶
FindGreaterOrEqual 在跳跃表中查找某个位置在传参后面或者与传参相等的SkipValue
Click to show internal directories.
Click to hide internal directories.