zset

package
v1.1.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 6 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 {
	sync.RWMutex
	// 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) GetType

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

GetType returns the type of the data structure

func (*SortedSet) MarshalBinary added in v1.0.8

func (sortedSet *SortedSet) MarshalBinary() ([]byte, error)

func (*SortedSet) UnmarshalBinary added in v1.0.8

func (sortedSet *SortedSet) UnmarshalBinary(data []byte) error

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) 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) 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) 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