set

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

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
}

func NewSet

func NewSet() *Set

NewSet creates a new set

func (*Set) GetValue added in v1.2.0

func (s *Set) GetValue() []string

GetValue the string to bytes

func (*Set) Iter added in v1.6.0

func (s *Set) Iter(fn func(member string) bool)

Iter returns an iterator for the set.

func (*Set) SAdd

func (s *Set) SAdd(member ...string) int64

SAdd adds a member to the set

func (*Set) SCard

func (s *Set) SCard() int64

SCard gets the set members count.

func (*Set) SClear added in v1.6.0

func (s *Set) SClear()

SClear clears the set.

func (*Set) SDiff

func (s *Set) SDiff(sets ...*Set) []string

SDiff gets the difference between sets.

func (*Set) SDiffStore

func (s *Set) SDiffStore(destination *Set, sets ...*Set)

SDiffStore gets the difference between sets and stores it in a new set.

func (*Set) SInter

func (s *Set) SInter(sets ...*Set) []string

SInter gets the intersection between sets.

func (*Set) SInterStore

func (s *Set) SInterStore(destination *Set, sets ...*Set)

SInterStore gets the intersection between sets and stores it in a new set.

func (*Set) SIsMember

func (s *Set) SIsMember(member string) bool

SIsMember checks if a member is in the set.

func (*Set) SMembers

func (s *Set) SMembers() []string

SMembers gets the set members.

func (*Set) SPop added in v1.5.0

func (s *Set) SPop(count int64) []string

SPop removes and returns a random member from the set.

func (*Set) SRandMember added in v1.6.0

func (s *Set) SRandMember(count int64) []string

SRandMember gets a random member from the set.

func (*Set) SRem

func (s *Set) SRem(member ...string) int64

SRem removes a member from the set.

func (*Set) SScan added in v1.5.0

func (s *Set) SScan(cursor int64, match string, count int64) (int64, []string)

SScan scans the set members.

func (*Set) SUnion

func (s *Set) SUnion(sets ...*Set) []string

SUnion gets the union between sets.

func (*Set) SUnionStore

func (s *Set) SUnionStore(destination *Set, sets ...*Set)

SUnionStore gets the union between sets and stores it in a new set.

func (*Set) SetValue added in v1.2.0

func (s *Set) SetValue(members []string)

SetValue the bytes to string

func (*Set) Type added in v1.2.0

func (s *Set) Type() ds.ValueType

Type returns the type of the data structure

Jump to

Keyboard shortcuts

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