Documentation ¶
Index ¶
- type Set
- func (set *Set) Add(val string) int
- func (set *Set) Diff(another *Set) *Set
- func (set *Set) ForEach(consumer func(member string) bool)
- func (set *Set) Has(val string) bool
- func (set *Set) Intersect(another *Set) *Set
- 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) ToSlice() []string
- func (set *Set) Union(another *Set) *Set
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
Click to show internal directories.
Click to hide internal directories.