Documentation ¶
Index ¶
- func Deduplicate(input []string) []string
- type Set
- func (s Set) Has(element string) bool
- func (s Set) Insert(element string)
- func (s Set) InsertMany(elements ...string)
- func (s Set) Intersect(other Set)
- func (s Set) Len() int
- func (s Set) Remove(element string)
- func (s *Set) Set(input string) error
- func (s Set) Slice() []string
- func (s *Set) String() string
- func (s Set) Subtract(other Set)
- func (s Set) Union(other Set)
- type StringFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deduplicate ¶
Deduplicate utilizes the Set type to generate a unique list of strings from the input slice.
Types ¶
type Set ¶
type Set map[string]nothing
Set implements set operations for string values.
func (Set) InsertMany ¶
InsertMany adds all the elements strings into the receiver Set.
func (Set) Intersect ¶
Intersect causes the receiver Set to only contain elements also found in the other Set argument.
type StringFilter ¶
type StringFilter struct {
// contains filtered or unexported fields
}
StringFilter implements an object that performs filtering of strings to ensure that only unique items get through the filter.
func NewStringFilter ¶
func NewStringFilter() *StringFilter
NewStringFilter returns an initialized StringFilter.
func (*StringFilter) Duplicate ¶
func (sf *StringFilter) Duplicate(s string) bool
Duplicate checks if the name provided has been seen before by this filter.
Click to show internal directories.
Click to hide internal directories.