Documentation ¶
Index ¶
- type HashSet
- func (hs HashSet) Add(hash *externalapi.DomainHash)
- func (hs HashSet) Contains(hash *externalapi.DomainHash) bool
- func (hs HashSet) ContainsAllInSlice(slice []*externalapi.DomainHash) bool
- func (hs HashSet) Length() int
- func (hs HashSet) Remove(hash *externalapi.DomainHash)
- func (hs HashSet) String() string
- func (hs HashSet) Subtract(other HashSet) HashSet
- func (hs HashSet) ToSlice() []*externalapi.DomainHash
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashSet ¶
type HashSet map[externalapi.DomainHash]struct{}
HashSet is an unsorted unique collection of DomainHashes
func NewFromSlice ¶
func NewFromSlice(hashes ...*externalapi.DomainHash) HashSet
NewFromSlice creates and returns a HashSet with contents according to provided slice
func (HashSet) Add ¶
func (hs HashSet) Add(hash *externalapi.DomainHash)
Add appends a hash to this HashSet. If given hash already exists - does nothing
func (HashSet) Contains ¶
func (hs HashSet) Contains(hash *externalapi.DomainHash) bool
Contains returns true if this HashSet contains the given hash.
func (HashSet) ContainsAllInSlice ¶
func (hs HashSet) ContainsAllInSlice(slice []*externalapi.DomainHash) bool
ContainsAllInSlice returns true if this HashSet contains all hashes in given slice
func (HashSet) Remove ¶
func (hs HashSet) Remove(hash *externalapi.DomainHash)
Remove removes a hash from this HashSet. If given hash does not exist in HashSet - does nothing.
func (HashSet) Subtract ¶
Subtract creates and returns a new HashSet that contains all hashes in this HashSet minus the ones in `other`
func (HashSet) ToSlice ¶
func (hs HashSet) ToSlice() []*externalapi.DomainHash
ToSlice converts this HashSet into a slice of hashes