Documentation ¶
Index ¶
- type EncodeKey
- type SkipList
- func (skl *SkipList) Delete(score float64, member string)
- func (skl *SkipList) GetByRank(rank uint64) *SklNode
- func (skl *SkipList) GetRank(score float64, member string) int64
- func (skl *SkipList) Insert(score float64, member string) *SklNode
- func (skl *SkipList) RevScoreRange(min, max float64) (val []interface{})
- func (skl *SkipList) ScoreRange(min, max float64) (val []interface{})
- func (skl *SkipList) Size() int64
- type SklLevel
- type SklNode
- type SortedSet
- func (z *SortedSet) IterateAndSend(chn chan *storage.LogEntry, encode EncodeKey)
- func (z *SortedSet) ZAdd(key string, score float64, member string)
- func (z *SortedSet) ZCard(key string) int
- func (z *SortedSet) ZClear(key string)
- func (z *SortedSet) ZGetByRank(key string, rank int) (val []interface{})
- func (z *SortedSet) ZIncrBy(key string, member string, increment float64) float64
- func (z *SortedSet) ZKeyExists(key string) bool
- func (z *SortedSet) ZRange(key string, start, stop int) []interface{}
- func (z *SortedSet) ZRangeWithScores(key string, start, stop int) []interface{}
- func (z *SortedSet) ZRank(key, member string) int64
- func (z *SortedSet) ZRem(key, member string) bool
- func (z *SortedSet) ZRevRange(key string, start, stop int) []interface{}
- func (z *SortedSet) ZRevRangeWithScores(key string, start, stop int) []interface{}
- func (z *SortedSet) ZRevRank(key, member string) int64
- func (z *SortedSet) ZRevScoreRange(key string, min, max float64) (val []interface{})
- func (z *SortedSet) ZScore(key string, member string) (ok bool, score float64)
- func (z *SortedSet) ZScoreRange(key string, min, max float64) (val []interface{})
- type SortedSetNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SkipList ¶
type SkipList struct {
// contains filtered or unexported fields
}
SkipList defines the structure of skip list.
func (*SkipList) GetByRank ¶
getByRank returns node according to the rank. If the node corresponding to the rank is not found, then nil will be returned.
func (*SkipList) GetRank ¶
getRank returns the rank of node according to score and member. // The rank (or index) is 1-based, which means that the member with the lowest score has rank 1. If the node corresponding to the score and member is not found, then 0 will be returned.
func (*SkipList) RevScoreRange ¶
RevScoreRange returns all the elements whose score is between min and max. The elements are consideres to be ordered from high to low scores.
func (*SkipList) ScoreRange ¶
ScoreRange returns all the elements whose score is between min and max. The elements are consideres to be ordered from low to high scores.
type SklLevel ¶
type SklLevel struct {
// contains filtered or unexported fields
}
SklLevel defines the structure of skip list level.
type SklNode ¶
type SklNode struct {
// contains filtered or unexported fields
}
SklNode defines the structure of skip list node.
type SortedSet ¶
type SortedSet struct {
// contains filtered or unexported fields
}
SortedSet defines the structure of sorted set.
func (*SortedSet) IterateAndSend ¶
func (*SortedSet) ZAdd ¶
ZAdd adds the specified member with the specified score to the sprted set stored at key.
func (*SortedSet) ZCard ¶
ZCard returns the sorted set cardinality (number of elements) of he sorted set stored at key.
func (*SortedSet) ZGetByRank ¶
ZGetByRank gets the member at key by rank, the rank is ordered from lowest to highest. The rank of lowest is 0 and so on.
func (*SortedSet) ZIncrBy ¶
ZIncrBy increments the score of member in the sorted set stored at key by increment. If member does not exist in the sorted set, it is added with increment as its score (as if its previous score was 0.0). If key does not exist, a new sroted set with the specified member as its sole member is created.
func (*SortedSet) ZKeyExists ¶
ZKeyExists checks if the key exists in the sorted set,
func (*SortedSet) ZRange ¶
ZRange returns the specified range of elements in the sorted set stored at key.
func (*SortedSet) ZRangeWithScores ¶
ZRangeWithScores returns the specified range of elements in the sorted set stored at key.
func (*SortedSet) ZRank ¶
ZRank returns the rank of member in the sorted set stored at key, with the scores ordered from low to high. The rank (or index) is 0-based, which means that the member with the lowest score has rank 0. If the key or the member does not exist, -1 will be returned.
func (*SortedSet) ZRem ¶
ZRem removes the specified members from the sorted set stored at key. Non existing members are ignored.
func (*SortedSet) ZRevRange ¶
ZRevRange returns the specified range of elements in the sorted set stored at key. The elements are considered to be ordered from the highest to the lowest score. Descending lexicographical order is used for elements with same score.
func (*SortedSet) ZRevRangeWithScores ¶
ZRevRangeWithScores returns the specified range of elements in the sorted set stored at key. The elements are considered to be ordered from the highest to the lowest score. Descending lexicographical order is used for elements with same score.
func (*SortedSet) ZRevRank ¶
ZRevRank returns the rank of member in the sorted set stored at key, with the scores ordered from high to low. The rank (or index) is 0-based, which means that the member with the highest score has rank 0.
func (*SortedSet) ZRevScoreRange ¶
ZRevScoreRange returns all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max). The elements are considered to be ordered from high to low scores.
func (*SortedSet) ZScoreRange ¶
ZScoreRange returns all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max). The elements are considered to be ordered from low to high scores.
type SortedSetNode ¶
type SortedSetNode struct {
// contains filtered or unexported fields
}
SortedSetNode defines the structure of sorted set node.