collections

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2025 License: Apache-2.0 Imports: 4 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsValue added in v0.4.1

func ContainsValue[K, V comparable](haystack map[K]V, needle V) bool

func CopyIterator

func CopyIterator[T any](it iterators.Iterator[*T]) (iterators.Iterator[*T], error)

func CopyMap

func CopyMap[K comparable, V any](to map[K]V, from map[K]V)

func Difference

func Difference[V comparable](a, b []V) []V

func Filter added in v0.4.1

func Filter[A any](iterator iterators.Iterator[*A], filter iterators.Predicate[*A]) iterators.Iterator[*A]

func GetUnique added in v0.4.1

func GetUnique[T any](vs iterators.Iterator[T]) (T, error)

func Intersection

func Intersection[V comparable](a, b []V) []V

func InverseMap

func InverseMap[K comparable, V comparable](in map[K]V) map[V]K

func Keys

func Keys[K comparable, V any](m map[K]V) []K

func Map

func Map[A any, B any](iterator iterators.Iterator[A], transformer func(A) (B, error)) iterators.Iterator[B]

func NewEmptyIterator

func NewEmptyIterator[K any]() iterators.Iterator[K]

func NewPermutatedIterator

func NewPermutatedIterator[T any](it iterators.Iterator[*T]) (iterators.Iterator[*T], error)

func NewSet

func NewSet[V comparable](items ...V) sets.Set[V]

func NewSingleIterator added in v0.4.1

func NewSingleIterator[T any](item T) iterators.Iterator[T]

func NewSliceIterator

func NewSliceIterator[T any](items []T) iterators.Iterator[T]

func ReadAll

func ReadAll[T any](it iterators.Iterator[*T]) ([]T, error)

func ReadFirst

func ReadFirst[T any](it iterators.Iterator[*T], limit int) ([]T, error)

func Remove

func Remove[T comparable](items []T, toRemove T) ([]T, bool)

func Repeat

func Repeat[T any](item T, times int) []T

func RepeatValue

func RepeatValue[K comparable, V any](keys []K, val V) map[K]V

func SubMap

func SubMap[K comparable, V any](m map[K]V, ks ...K) (map[K]V, []K)

func Values

func Values[K comparable, V any](m map[K]V) []V

Types

type Iterator

type Iterator[V any] iterators.Iterator[V]

type Set

type Set[V comparable] sets.Set[V]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL