zset

package
v1.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item added in v1.0.8

type Item struct {
	Member string
	Score  float64
}

Item is a key-score pair

type Level

type Level struct {
	// contains filtered or unexported fields
}

Level aspect of a node

type SortedSet

type SortedSet struct {
	// contains filtered or unexported fields
}

SortedSet is a set which keys sorted by bound score

func NewSortedSet

func NewSortedSet() *SortedSet

NewSortedSet makes a new SortedSet

func (*SortedSet) GetValue added in v1.2.0

func (sortedSet *SortedSet) GetValue() []*pb.KeyScore

func (*SortedSet) SetValue added in v1.2.0

func (sortedSet *SortedSet) SetValue(keyScores []*pb.KeyScore)

func (*SortedSet) Type added in v1.2.0

func (sortedSet *SortedSet) Type() ds.DataType

Type returns the type of the data structure

func (*SortedSet) ZAdd

func (sortedSet *SortedSet) ZAdd(member string, score float64) bool

ZAdd puts member into set, and returns whether it has inserted new node

func (*SortedSet) ZAddGT added in v1.5.0

func (sortedSet *SortedSet) ZAddGT(member string, score float64) bool

ZAddGT add member if score greater than the current score

func (*SortedSet) ZAddLT added in v1.5.0

func (sortedSet *SortedSet) ZAddLT(member string, score float64) bool

ZAddLT add member if score less than the current score

func (*SortedSet) ZAddNX added in v1.5.0

func (sortedSet *SortedSet) ZAddNX(member string, score float64) bool

ZAddNX Only add new elements. Don't update already existing elements.

func (*SortedSet) ZAddXX added in v1.5.0

func (sortedSet *SortedSet) ZAddXX(member string, score float64) bool

ZAddXX Only update elements that already exist. Don't add new elements.

func (*SortedSet) ZCard

func (sortedSet *SortedSet) ZCard() int64

ZCard returns number of members in set

func (*SortedSet) ZCount

func (sortedSet *SortedSet) ZCount(min float64, max float64) int64

ZCount returns the number of members which score or member within the given border

func (*SortedSet) ZExists

func (sortedSet *SortedSet) ZExists(member string) bool

ZExists returns whether the given member exists in set

func (*SortedSet) ZIncrBy

func (sortedSet *SortedSet) ZIncrBy(member string, score float64) float64

ZIncrBy increases the score of the given member

func (*SortedSet) ZRange

func (sortedSet *SortedSet) ZRange(start int64, stop int64) []*Item

ZRange returns members which rank within [start, stop), sort by ascending order, rank starts from 0

func (*SortedSet) ZRangeByScore

func (sortedSet *SortedSet) ZRangeByScore(min float64, max float64) []*Item

ZRangeByScore returns members which score or member within the given border

func (*SortedSet) ZRank

func (sortedSet *SortedSet) ZRank(member string) int64

ZRank returns the rank of the given member, sort by ascending order, rank starts from 0

func (*SortedSet) ZRankWithScore added in v1.5.0

func (sortedSet *SortedSet) ZRankWithScore(member string) (int64, *Item)

ZRankWithScore returns the rank of the given member, sort by ascending order, rank starts from 0

func (*SortedSet) ZRem

func (sortedSet *SortedSet) ZRem(member string) bool

ZRem removes the given member from set

func (*SortedSet) ZRemRangeByRank

func (sortedSet *SortedSet) ZRemRangeByRank(start int64, stop int64) int64

ZRemRangeByRank removes member ranking within [start, stop) sort by ascending order and rank starts from 0

func (*SortedSet) ZRemRangeByScore

func (sortedSet *SortedSet) ZRemRangeByScore(min float64, max float64) int64

ZRemRangeByScore removes members which score or member within the given border

func (*SortedSet) ZRevRange

func (sortedSet *SortedSet) ZRevRange(start int64, stop int64) []*Item

ZRevRange returns members which rank within [start, stop), sort by descending order, rank starts from 0

func (*SortedSet) ZRevRangeByScore

func (sortedSet *SortedSet) ZRevRangeByScore(min float64, max float64) []*Item

ZRevRangeByScore returns members which score or member within the given border

func (*SortedSet) ZRevRank

func (sortedSet *SortedSet) ZRevRank(member string) int64

ZRevRank returns the rank of the given member, sort by descending order, rank starts from 0

func (*SortedSet) ZRevRankWithScore added in v1.5.0

func (sortedSet *SortedSet) ZRevRankWithScore(member string) (int64, *Item)

ZRevRankWithScore returns the rank of the given member, sort by descending order, rank starts from 0

func (*SortedSet) ZScore

func (sortedSet *SortedSet) ZScore(member string) float64

ZScore returns the score of the given member

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL