zset

package
v0.0.0-...-baaee6e Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicOps

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

BasicOps handles basic operations for sorted sets

func NewBasicOps

func NewBasicOps(cache *sync.Map, keyVersions *sync.Map) *BasicOps

NewBasicOps creates a new BasicOps instance

func (*BasicOps) ZAdd

func (b *BasicOps) ZAdd(key string, score float64, member string) error

ZAdd adds a member with score to a sorted set

func (*BasicOps) ZCard

func (b *BasicOps) ZCard(key string) int

ZCard returns the number of members in a sorted set

func (*BasicOps) ZRandMember

func (b *BasicOps) ZRandMember(key string, count int, withScores bool) []models.ZSetMember

ZRandMember returns random members from a sorted set

func (*BasicOps) ZRandMemberWithoutScores

func (b *BasicOps) ZRandMemberWithoutScores(key string, count int) []string

ZRandMemberWithoutScores returns random members without their scores

func (*BasicOps) ZRem

func (b *BasicOps) ZRem(key string, member string) error

ZRem removes a member from a sorted set

func (*BasicOps) ZScore

func (b *BasicOps) ZScore(key string, member string) (float64, bool)

ZScore returns the score of a member in a sorted set

type LexOps

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

func NewLexOps

func NewLexOps(basicOps *BasicOps) *LexOps

func (*LexOps) ZLexCount

func (l *LexOps) ZLexCount(key string, min, max string) (int, error)

ZLexCount returns the number of elements in sorted set between min and max

func (*LexOps) ZRangeByLex

func (l *LexOps) ZRangeByLex(key string, min, max string) []string

ZRangeByLex returns elements in sorted set between min and max lexicographically

func (*LexOps) ZRemRangeByLex

func (l *LexOps) ZRemRangeByLex(key string, min, max string) (int, error)

ZRemRangeByLex removes elements in sorted set between min and max lexicographically

func (*LexOps) ZRevRangeByLex

func (l *LexOps) ZRevRangeByLex(key string, max, min string) []string

ZRevRangeByLex returns elements in sorted set between max and min lexicographically

type Manager

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

Manager coordinates all ZSet operations

func NewManager

func NewManager(cache *sync.Map, version *sync.Map) *Manager

NewManager creates a new ZSet manager with all operations

func (*Manager) ZAdd

func (m *Manager) ZAdd(key string, score float64, member string) error

Basic Operations

func (*Manager) ZCard

func (m *Manager) ZCard(key string) int

func (*Manager) ZCount

func (m *Manager) ZCount(key string, min, max float64) int

func (*Manager) ZDiff

func (m *Manager) ZDiff(keys ...string) []string

func (*Manager) ZDiffStore

func (m *Manager) ZDiffStore(destination string, keys ...string) (int, error)

func (*Manager) ZIncrBy

func (m *Manager) ZIncrBy(key string, increment float64, member string) (float64, error)

Score Operations

func (*Manager) ZInter

func (m *Manager) ZInter(keys ...string) []string

func (*Manager) ZInterCard

func (m *Manager) ZInterCard(keys ...string) (int, error)

func (*Manager) ZInterStore

func (m *Manager) ZInterStore(destination string, keys []string, weights []float64) (int, error)

func (*Manager) ZLexCount

func (m *Manager) ZLexCount(key string, min, max string) (int, error)

func (*Manager) ZMScore

func (m *Manager) ZMScore(key string, members ...string) []float64

Score operasyonlarının tamamlanması

func (*Manager) ZPopMax

func (m *Manager) ZPopMax(key string) (models.ZSetMember, bool)

func (*Manager) ZPopMaxN

func (m *Manager) ZPopMaxN(key string, count int) []models.ZSetMember

func (*Manager) ZPopMin

func (m *Manager) ZPopMin(key string) (models.ZSetMember, bool)

func (*Manager) ZPopMinN

func (m *Manager) ZPopMinN(key string, count int) []models.ZSetMember

func (*Manager) ZRandMember

func (m *Manager) ZRandMember(key string, count int, withScores bool) []models.ZSetMember

func (*Manager) ZRandMemberWithoutScores

func (m *Manager) ZRandMemberWithoutScores(key string, count int) []string

func (*Manager) ZRange

func (m *Manager) ZRange(key string, start, stop int) []string

Range Operations

func (*Manager) ZRangeByLex

func (m *Manager) ZRangeByLex(key string, min, max string) []string

Lexicographical Operations

func (*Manager) ZRangeByScore

func (m *Manager) ZRangeByScore(key string, min, max float64) []string

func (*Manager) ZRangeByScoreWithScores

func (m *Manager) ZRangeByScoreWithScores(key string, min, max float64) []models.ZSetMember

func (*Manager) ZRangeStore

func (m *Manager) ZRangeStore(destination string, source string, start, stop int, withScores bool) (int, error)

func (*Manager) ZRangeWithScores

func (m *Manager) ZRangeWithScores(key string, start, stop int) []models.ZSetMember

func (*Manager) ZRank

func (m *Manager) ZRank(key string, member string) (int, bool)

Rank Operations

func (*Manager) ZRem

func (m *Manager) ZRem(key string, member string) error

func (*Manager) ZRemRangeByLex

func (m *Manager) ZRemRangeByLex(key string, min, max string) (int, error)

func (*Manager) ZRemRangeByRank

func (m *Manager) ZRemRangeByRank(key string, start, stop int) (int, error)

Modify Operations

func (*Manager) ZRemRangeByScore

func (m *Manager) ZRemRangeByScore(key string, min, max float64) (int, error)

func (*Manager) ZRevRange

func (m *Manager) ZRevRange(key string, start, stop int) []string

func (*Manager) ZRevRangeByLex

func (m *Manager) ZRevRangeByLex(key string, max, min string) []string

Lex operasyonlarının tamamlanması

func (*Manager) ZRevRangeByScore

func (m *Manager) ZRevRangeByScore(key string, max, min float64) []string

func (*Manager) ZRevRangeWithScores

func (m *Manager) ZRevRangeWithScores(key string, start, stop int) []models.ZSetMember

func (*Manager) ZRevRank

func (m *Manager) ZRevRank(key string, member string) (int, bool)

func (*Manager) ZScan

func (m *Manager) ZScan(key string, cursor int, match string, count int) ([]models.ZSetMember, int)

Scan Operations

func (*Manager) ZScore

func (m *Manager) ZScore(key string, member string) (float64, bool)

func (*Manager) ZUnion

func (m *Manager) ZUnion(keys ...string) []models.ZSetMember

Set Operations

func (*Manager) ZUnionStore

func (m *Manager) ZUnionStore(destination string, keys []string, weights []float64) (int, error)

Set operasyonlarının tamamlanması

type ModifyOps

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

func NewModifyOps

func NewModifyOps(basicOps *BasicOps) *ModifyOps

func (*ModifyOps) ZRemRangeByRank

func (m *ModifyOps) ZRemRangeByRank(key string, start, stop int) (int, error)

ZRemRangeByRank removes all elements in the sorted set with rank between start and stop

func (*ModifyOps) ZRemRangeByScore

func (m *ModifyOps) ZRemRangeByScore(key string, min, max float64) (int, error)

ZRemRangeByScore removes all elements in the sorted set with score between min and max

type RangeOps

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

func NewRangeOps

func NewRangeOps(basicOps *BasicOps) *RangeOps

func (*RangeOps) ZPopMax

func (r *RangeOps) ZPopMax(key string, count int) []models.ZSetMember

ZPopMax removes and returns members with the highest score

func (*RangeOps) ZPopMaxOne

func (r *RangeOps) ZPopMaxOne(key string) (models.ZSetMember, bool)

Convenience methods for single element operations

func (*RangeOps) ZPopMin

func (r *RangeOps) ZPopMin(key string, count int) []models.ZSetMember

ZPopMin removes and returns members with the lowest score

func (*RangeOps) ZPopMinOne

func (r *RangeOps) ZPopMinOne(key string) (models.ZSetMember, bool)

func (*RangeOps) ZRange

func (r *RangeOps) ZRange(key string, start, stop int) []string

Range Operations

func (*RangeOps) ZRangeByScore

func (r *RangeOps) ZRangeByScore(key string, min, max float64) []string

func (*RangeOps) ZRangeByScoreWithScores

func (r *RangeOps) ZRangeByScoreWithScores(key string, min, max float64) []models.ZSetMember

func (*RangeOps) ZRangeStore

func (r *RangeOps) ZRangeStore(destination string, source string, start, stop int, withScores bool) (int, error)

func (*RangeOps) ZRangeWithScores

func (r *RangeOps) ZRangeWithScores(key string, start, stop int) []models.ZSetMember

func (*RangeOps) ZRevRange

func (r *RangeOps) ZRevRange(key string, start, stop int) []string

func (*RangeOps) ZRevRangeByScore

func (r *RangeOps) ZRevRangeByScore(key string, max, min float64) []string

func (*RangeOps) ZRevRangeWithScores

func (r *RangeOps) ZRevRangeWithScores(key string, start, stop int) []models.ZSetMember

type RankOps

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

func NewRankOps

func NewRankOps(basicOps *BasicOps) *RankOps

func (*RankOps) ZRank

func (r *RankOps) ZRank(key string, member string) (int, bool)

ZRank returns the rank of member in the sorted set stored at key. The rank (or index) is 0-based, which means that the member with the lowest score has rank 0.

func (*RankOps) ZRevRank

func (r *RankOps) ZRevRank(key string, member string) (int, bool)

ZRevRank returns the rank of member in the sorted set stored at key, with the scores ordered from high to low.

type ScanOps

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

func NewScanOps

func NewScanOps(basicOps *BasicOps) *ScanOps

func (*ScanOps) ZScan

func (s *ScanOps) ZScan(key string, cursor int, match string, count int) ([]models.ZSetMember, int)

ZScan iterates over members in a sorted set

type ScoreOps

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

func NewScoreOps

func NewScoreOps(basicOps *BasicOps) *ScoreOps

func (*ScoreOps) ZCount

func (s *ScoreOps) ZCount(key string, min, max float64) int

ZCount returns the number of members with score in the given range

func (*ScoreOps) ZIncrBy

func (s *ScoreOps) ZIncrBy(key string, increment float64, member string) (float64, error)

ZIncrBy increments the score of a member

func (*ScoreOps) ZMScore

func (s *ScoreOps) ZMScore(key string, members ...string) []float64

ZMScore returns the scores of multiple members

type SetOps

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

func NewSetOps

func NewSetOps(basicOps *BasicOps) *SetOps

func (*SetOps) ZDiff

func (s *SetOps) ZDiff(keys ...string) []string

ZDiff returns the set difference between the first and subsequent sets

func (*SetOps) ZDiffStore

func (s *SetOps) ZDiffStore(destination string, keys ...string) (int, error)

ZDiffStore stores the difference from first set to others in destination

func (*SetOps) ZInter

func (s *SetOps) ZInter(keys ...string) []string

ZInter returns the intersection of multiple sorted sets

func (*SetOps) ZInterCard

func (s *SetOps) ZInterCard(keys ...string) (int, error)

ZInterCard returns the number of members in the intersection of multiple sets

func (*SetOps) ZInterStore

func (s *SetOps) ZInterStore(destination string, keys []string, weights []float64) (int, error)

ZInterStore stores intersection of sets in destination

func (*SetOps) ZUnion

func (s *SetOps) ZUnion(keys ...string) []models.ZSetMember

ZUnion returns the union of multiple sorted sets

func (*SetOps) ZUnionStore

func (s *SetOps) ZUnionStore(destination string, keys []string, weights []float64) (int, error)

ZUnionStore stores the union of sets in destination

Jump to

Keyboard shortcuts

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