Versions in this module Expand all Collapse all v0 v0.1.1 Dec 31, 2024 v0.1.0 Dec 31, 2024 Changes in this version + type BinarySearchOperation struct + FoundIndex int + Predicate func(T) bool + func (b *BinarySearchOperation[T]) Apply(data []T) ([]T, error) + func (b *BinarySearchOperation[T]) GetFoundIndex() int + type DistinctOperation struct + Equal func(a, b T) bool + func (d *DistinctOperation[T]) Apply(data []T) ([]T, error) + type FilterOperation struct + Predicate func(T) bool + func (f *FilterOperation[T]) Apply(data []T) ([]T, error) + type FindOperation struct + Predicate func(T) bool + func (f *FindOperation[T]) Apply(data []T) ([]T, error) + type GroupedItem struct + Items []T + Key K + func GroupBy[T any, K comparable](data []T, keyFunc func(T) K) []GroupedItem[K, T] + type HeapSortOperation struct + Comparator func(a, b T) bool + func (h *HeapSortOperation[T]) Apply(data []T) ([]T, error) + type Item struct + Active bool + ID int + Name string + type LinearSearchOperation struct + Predicate func(T) bool + func (l *LinearSearchOperation[T]) Apply(data []T) ([]T, error) + type MapOperation struct + Mapper func(T) T + func (m *MapOperation[T]) Apply(data []T) ([]T, error) + type MergeSortOperation struct + Comparator func(a, b T) bool + func (m *MergeSortOperation[T]) Apply(data []T) ([]T, error) + type Operation interface + Apply func(data []T) ([]T, error) + type Order struct + Item string + OrderID int + UserID int + type Pipeline struct + func NewPipelineWithData[T comparable](data []T) *Pipeline[T] + func NewPipeline[T comparable]() *Pipeline[T] + func (p *Pipeline[T]) AddOperation(op Operation[T]) *Pipeline[T] + func (p *Pipeline[T]) BinarySearch(predicate func(T) bool) *Pipeline[T] + func (p *Pipeline[T]) Distinct(equal func(a, b T) bool) *Pipeline[T] + func (p *Pipeline[T]) Execute() ([]T, error) + func (p *Pipeline[T]) Filter(predicate func(T) bool) *Pipeline[T] + func (p *Pipeline[T]) Find(predicate func(T) bool) *Pipeline[T] + func (p *Pipeline[T]) GetOperations() []Operation[T] + func (p *Pipeline[T]) HeapSort(comparator func(a, b T) bool) *Pipeline[T] + func (p *Pipeline[T]) LinearSearch(predicate func(T) bool) *Pipeline[T] + func (p *Pipeline[T]) LinearSearchExact(target T) *Pipeline[T] + func (p *Pipeline[T]) Map(mapper func(T) T) *Pipeline[T] + func (p *Pipeline[T]) MergeSort(comparator func(a, b T) bool) *Pipeline[T] + func (p *Pipeline[T]) QuickSort(comparator func(a, b T) bool) *Pipeline[T] + func (p *Pipeline[T]) Reduce(reducer func(acc, item T) T) *Pipeline[T] + func (p *Pipeline[T]) Skip(count int) *Pipeline[T] + func (p *Pipeline[T]) Take(count int) *Pipeline[T] + func (p *Pipeline[T]) WithData(data []T) *Pipeline[T] + type QuickSortOperation struct + Comparator func(a, b T) bool + func (q *QuickSortOperation[T]) Apply(data []T) ([]T, error) + type ReduceOperation struct + Reducer func(acc, item T) T + func (r *ReduceOperation[T]) Apply(data []T) ([]T, error) + type SkipOperation struct + Count int + func (s *SkipOperation[T]) Apply(data []T) ([]T, error) + type TakeOperation struct + Count int + func (t *TakeOperation[T]) Apply(data []T) ([]T, error) + type User struct + Active bool + ID int + Name string