Documentation ¶
Overview ¶
Package colf contains some commonly used collections abstractions.
Index ¶
- func AddAll[E any](appendable Addable[E], iterable Iterable[E])
- func Contains[E comparable](iterable Iterable[E], value E) (match bool)
- type Addable
- type ForEach
- type Iterable
- type Set
- func (s *Set[E]) Add(element E)
- func (s Set[E]) ForEach(forEach ForEach[E])
- func (s Set[E]) MarshalJSON() ([]byte, error)
- func (s Set[E]) MarshalYAML() (interface{}, error)
- func (s Set[E]) Size() int
- func (s *Set[E]) UnmarshalJSON(data []byte) error
- func (s *Set[E]) UnmarshalYAML(node *yaml.Node) error
- type Sizeable
- type Slice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAll ¶
func AddAll[E any](appendable Addable[E], iterable Iterable[E])
AddAll adds all elements from Iterable to Addable.
func Contains ¶
func Contains[E comparable](iterable Iterable[E], value E) (match bool)
Contains checks if an element is in an Iterable.
Types ¶
type Addable ¶
type Addable[E any] interface{ Add(element E) }
Addable is a mutable collection which can be added elements to.
type Set ¶
type Set[E comparable] map[E]bool
Set contains non-repeating values.
func (Set[E]) MarshalJSON ¶
func (Set[E]) MarshalYAML ¶
func (*Set[E]) UnmarshalJSON ¶
func (*Set[E]) UnmarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.