Documentation ¶
Index ¶
- type Set
- func (set *Set) Add(val string) int
- func (set *Set) ForEach(consumer func(member string) bool)
- func (set *Set) Has(val string) bool
- func (set *Set) Len() int
- func (set *Set) RandomDistinctMembers(limit int) []string
- func (set *Set) RandomMembers(limit int) []string
- func (set *Set) Remove(val string) int
- func (set *Set) SetScan(cursor int, count int, pattern string) ([][]byte, int)
- func (set *Set) ShallowCopy() *Set
- func (set *Set) ToSlice() []string
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
}
Set is a set of elements based on hash table
func (*Set) RandomDistinctMembers ¶
RandomDistinctMembers randomly returns keys of the given number, won't contain duplicated key
func (*Set) RandomMembers ¶
RandomMembers randomly returns keys of the given number, may contain duplicated key
func (*Set) ShallowCopy ¶
ShallowCopy copies all members to another set
Click to show internal directories.
Click to hide internal directories.