Documentation
¶
Index ¶
- type Border
- type Level
- type LexBorder
- type Pair
- type ScoreBorder
- type SortedSet
- func (s *SortedSet) Add(member string, score float64) bool
- func (s *SortedSet) ForEach(min, max Border, offset int64, count int64, desc bool, ...)
- func (s *SortedSet) ForEachByRank(start, stop int64, desc bool, consumer func(pair *Pair) bool) error
- func (s *SortedSet) Get(member string) (*Pair, bool)
- func (s *SortedSet) GetRank(member string, desc bool) (rank int64)
- func (s *SortedSet) Len() int64
- func (s *SortedSet) PopMin(count int) []*Pair
- func (s *SortedSet) Range(min Border, max Border, offset int64, count int64, desc bool) []*Pair
- func (s *SortedSet) RangeByRank(start, stop int64, desc bool) []*Pair
- func (s *SortedSet) RangeCount(min, max Border) int64
- func (s *SortedSet) Remove(member string) bool
- func (s *SortedSet) RemoveByRank(start int64, stop int64) int64
- func (s *SortedSet) RemoveRange(min Border, max Border) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Border ¶
type Border interface {
// contains filtered or unexported methods
}
func ParseLexBorder ¶
ParseLexBorder creates LexBorder from redis arguments
func ParseScoreBorder ¶
模拟score的范围 ParseScoreBorder creates ScoreBorder from redis arguments
type LexBorder ¶
模拟字符串的范围 LexBorder represents range of a string value, including: <, <=, >, >=, +, -
type ScoreBorder ¶
ScoreBorder represents range of a float value, including: <, <=, >, >=, +inf, -inf
type SortedSet ¶
type SortedSet struct {
// contains filtered or unexported fields
}
score可以相同,member不能重复
func NewSortedSet ¶
func NewSortedSet() *SortedSet
func (*SortedSet) ForEach ¶
func (s *SortedSet) ForEach(min, max Border, offset int64, count int64, desc bool, consumer func(pair *Pair) bool)
扫描[min,max] 范围内的节点,从偏移min + offset位置开始,扫面 count 个元素
func (*SortedSet) ForEachByRank ¶
func (s *SortedSet) ForEachByRank(start, stop int64, desc bool, consumer func(pair *Pair) bool) error
start / stop都是正数 进行范围查询,扫描有序链表[start,stop)索引范围的节点,desc表示按照正序还是倒序
func (*SortedSet) RangeByRank ¶
扫描[start,stop)范围的节点,起始索引从0开始
func (*SortedSet) RangeCount ¶
func (*SortedSet) RemoveByRank ¶
表示删除索引[start,stop)的节点
Click to show internal directories.
Click to hide internal directories.