set

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: 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 {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSet

func NewSet() *Set

NewSet creates a new set

func (*Set) GetType

func (s *Set) GetType() ds.DataType

GetType returns the type of the data structure

func (*Set) MarshalBinary added in v1.0.8

func (s *Set) MarshalBinary() ([]byte, error)

MarshalBinary the string to bytes

func (*Set) SAdd

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

SAdd adds a member to the set

func (*Set) SCard

func (s *Set) SCard() int

SCard gets the set members count.

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

func (s *Set) SRem(member string)

SRem removes a member from the set.

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) UnmarshalBinary added in v1.0.8

func (s *Set) UnmarshalBinary(data []byte) error

UnmarshalBinary the bytes to string

Jump to

Keyboard shortcuts

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