Documentation
¶
Index ¶
- type Item
- type Set
- func (ss *Set) CountInRange(minVal, maxVal float64) int
- func (ss *Set) Get(member string) (float64, bool)
- func (ss *Set) GetMin(count int) []string
- func (ss *Set) GetRange(start, stop int, withScores bool, reverse bool) []string
- func (ss *Set) Len() int
- func (ss *Set) PopMax(count int) []string
- func (ss *Set) PopMin(count int) []string
- func (ss *Set) RankWithScore(member string, reverse bool) (rank int64, score float64)
- func (ss *Set) Remove(member string) bool
- func (ss *Set) Serialize(buf *bytes.Buffer) error
- func (ss *Set) Upsert(score float64, member string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
is a sorted set data structure that stores members with associated scores.
func (*Set) CountInRange ¶
Iterate over elements in the B-Tree with scores in the [min, max] range
func (*Set) GetMin ¶
GetMin returns the first 'count' key-value pairs (member and score) with the minimum scores and removes those items from the sorted set.
func (*Set) GetRange ¶
GetRange returns a slice of members with scores between min and max, inclusive. it returns the members in ascending order if reverse is false, and descending order if reverse is true. If withScores is true, the members will be returned with their scores.
func (*Set) PopMax ¶
This func is used to remove the maximum element from the sortedset. It takes count as an argument which tells the number of elements to be removed from the sortedset.
func (*Set) PopMin ¶ added in v1.0.6
This func is used to remove the minimum element from the sortedset. It takes count as an argument which tells the number of elements to be removed from the sortedset.