Documentation ¶
Index ¶
- type Element
- type Level
- type ScoreBorder
- type SortedSet
- func (sortedSet *SortedSet) Add(member string, score float64) bool
- func (sortedSet *SortedSet) Count(min *ScoreBorder, max *ScoreBorder) int64
- func (sortedSet *SortedSet) ForEach(start int64, stop int64, desc bool, consumer func(element *Element) bool)
- func (sortedSet *SortedSet) ForEachByScore(min *ScoreBorder, max *ScoreBorder, offset int64, limit int64, desc bool, ...)
- func (sortedSet *SortedSet) Get(member string) (element *Element, ok bool)
- func (sortedSet *SortedSet) GetRank(member string, desc bool) (rank int64)
- func (sortedSet *SortedSet) Len() int64
- func (sortedSet *SortedSet) PopMin(count int) []*Element
- func (sortedSet *SortedSet) Range(start int64, stop int64, desc bool) []*Element
- func (sortedSet *SortedSet) RangeByScore(min *ScoreBorder, max *ScoreBorder, offset int64, limit int64, desc bool) []*Element
- func (sortedSet *SortedSet) Remove(member string) bool
- func (sortedSet *SortedSet) RemoveByRank(start int64, stop int64) int64
- func (sortedSet *SortedSet) RemoveByScore(min *ScoreBorder, max *ScoreBorder) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScoreBorder ¶
ScoreBorder represents range of a float value, including: <, <=, >, >=, +inf, -inf
func ParseScoreBorder ¶
func ParseScoreBorder(s string) (*ScoreBorder, error)
ParseScoreBorder creates ScoreBorder from redis arguments
type SortedSet ¶
type SortedSet struct {
// contains filtered or unexported fields
}
SortedSet is a set which keys sorted by bound score
func (*SortedSet) Count ¶
func (sortedSet *SortedSet) Count(min *ScoreBorder, max *ScoreBorder) int64
Count returns the number of members which score within the given border
func (*SortedSet) ForEach ¶
func (sortedSet *SortedSet) ForEach(start int64, stop int64, desc bool, consumer func(element *Element) bool)
ForEach visits each member which rank within [start, stop), sort by ascending order, rank starts from 0
func (*SortedSet) ForEachByScore ¶
func (sortedSet *SortedSet) ForEachByScore(min *ScoreBorder, max *ScoreBorder, offset int64, limit int64, desc bool, consumer func(element *Element) bool)
ForEachByScore visits members which score within the given border
func (*SortedSet) GetRank ¶
GetRank returns the rank of the given member, sort by ascending order, rank starts from 0
func (*SortedSet) Range ¶
Range returns members which rank within [start, stop), sort by ascending order, rank starts from 0
func (*SortedSet) RangeByScore ¶
func (sortedSet *SortedSet) RangeByScore(min *ScoreBorder, max *ScoreBorder, offset int64, limit int64, desc bool) []*Element
RangeByScore returns members which score within the given border param limit: <0 means no limit
func (*SortedSet) RemoveByRank ¶
RemoveByRank removes member ranking within [start, stop) sort by ascending order and rank starts from 0
func (*SortedSet) RemoveByScore ¶
func (sortedSet *SortedSet) RemoveByScore(min *ScoreBorder, max *ScoreBorder) int64
RemoveByScore removes members which score within the given border