Documentation ¶
Overview ¶
Package hset implements a hset backed by a hash table.
Structure is thread safe.
Index ¶
- type Hset
- func (hset *Hset) Add(items ...interface{})
- func (hset *Hset) Clear()
- func (hset *Hset) Contains(items ...interface{}) bool
- func (hset *Hset) Empty() bool
- func (hset *Hset) Exists(item interface{}) bool
- func (set *Hset) FromJSON(data []byte) error
- func (hset *Hset) Len() int
- func (hset *Hset) Remove(items ...interface{})
- func (hset *Hset) Same(other Set) bool
- func (hset *Hset) String(pre ...bool) string
- func (set *Hset) ToJSON() ([]byte, error)
- func (hset *Hset) Values() []interface{}
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hset ¶
type Hset struct { // items sync.Map[interface{}]struct{} sync.RWMutex // contains filtered or unexported fields }
Hset holds elements in go's native map
func (*Hset) Add ¶
func (hset *Hset) Add(items ...interface{})
Add adds the items (one or more) to the hset.
func (*Hset) Contains ¶
Contains check if items (one or more) are present in the hset. All items have to be present in the hset for the method to return true. Returns true if no arguments are passed at all, i.e. hset is always superhset of empty hset.
func (*Hset) Remove ¶
func (hset *Hset) Remove(items ...interface{})
Remove removes the items (one or more) from the hset.
Click to show internal directories.
Click to hide internal directories.