Versions in this module Expand all Collapse all v1 v1.4.4 Nov 9, 2022 v1.4.3 Nov 9, 2022 Changes in this version + var ErrCancelWithNil = errors.New("mapreduce cancelled with nil") + var ErrReduceNoOutput = errors.New("reduce not writing value") + func Finish(fns ...func() error) error + func FinishVoid(fns ...func()) + func ForEach(generate GenerateFunc, mapper ForEachFunc, opts ...Option) + func MapReduce(generate GenerateFunc, mapper MapperFunc, reducer ReducerFunc, opts ...Option) (interface{}, error) + func MapReduceChan(source <-chan interface{}, mapper MapperFunc, reducer ReducerFunc, ...) (interface{}, error) + func MapReduceVoid(generate GenerateFunc, mapper MapperFunc, reducer VoidReducerFunc, ...) error + type ForEachFunc func(item interface{}) + type GenerateFunc func(source chan<- interface{}) + type MapFunc func(item interface{}, writer Writer) + type MapperFunc func(item interface{}, writer Writer, cancel func(error)) + type Option func(opts *mapReduceOptions) + func WithContext(ctx context.Context) Option + func WithWorkers(workers int) Option + type ReducerFunc func(pipe <-chan interface{}, writer Writer, cancel func(error)) + type VoidReducerFunc func(pipe <-chan interface{}, cancel func(error)) + type Writer interface + Write func(v interface{})