sorted_set

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commands

func Commands() []internal.Command

Types

type MemberObject

type MemberObject struct {
	Value  Value
	Score  Score
	Exists bool
}

MemberObject is the shape of the object as it's stored in the map that represents the Set

type MemberParam

type MemberParam struct {
	Value Value
	Score Score
}

MemberParam is the shape of the object passed as a parameter to NewSortedSet and the Add method

type Score

type Score float64

type SortedSet

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

func Intersect

func Intersect(aggregate string, setParams ...SortedSetParam) *SortedSet

Intersect uses divide & conquer to calculate the intersection of multiple sets

func NewSortedSet

func NewSortedSet(members []MemberParam) *SortedSet

func Union

func Union(aggregate string, setParams ...SortedSetParam) *SortedSet

Union uses divided & conquer to calculate the union of multiple sets

func (*SortedSet) AddOrUpdate

func (set *SortedSet) AddOrUpdate(
	members []MemberParam, updatePolicy interface{}, comparison interface{}, changed interface{}, incr interface{},
) (int, error)

func (*SortedSet) Cardinality

func (set *SortedSet) Cardinality() int

func (*SortedSet) Contains

func (set *SortedSet) Contains(m Value) bool

func (*SortedSet) Equals

func (set *SortedSet) Equals(other *SortedSet) bool

func (*SortedSet) Get

func (set *SortedSet) Get(v Value) MemberObject

func (*SortedSet) GetAll

func (set *SortedSet) GetAll() []MemberParam

func (*SortedSet) GetRandom

func (set *SortedSet) GetRandom(count int) []MemberParam

func (*SortedSet) Pop

func (set *SortedSet) Pop(count int, policy string) (*SortedSet, error)

func (*SortedSet) Remove

func (set *SortedSet) Remove(v Value) bool

func (*SortedSet) Subtract

func (set *SortedSet) Subtract(others []*SortedSet) *SortedSet

type SortedSetParam

type SortedSetParam struct {
	Set    *SortedSet
	Weight int
}

SortedSetParam is a composite object used for Intersect and Union function

type Value

type Value string

Jump to

Keyboard shortcuts

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