collect

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package collect provides util functions and types to implement the Collect method of a c.Transformable implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Groups

func Groups[K comparable, V any](it c.KVIterator[K, V]) map[K][]V

Groups collects sets of values grouped by keys obtained by passing a key/value iterator.

func Map

func Map[K comparable, V any](it c.KVIterator[K, V]) map[K]V

Map instantiates a map with the key/values obtained by passing over a key/value iterator.

Types

type Collector

type Collector[t any, out any] c.Converter[c.Iterator[t], out]

Collector is Converter of Iterator that collects all values to any slice or map, mostly used to extract slice fields to flatting a result.

type CollectorKV

type CollectorKV[k, v any, out any] func(c.KVIterator[k, v]) out

CollectorKV is Converter of key/value Iterator that collects all values to any slice or map, mostly used to extract slice fields to flatting a result.

Jump to

Keyboard shortcuts

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