func (m Multi) CollectOverall(ctx context.Context, inputChunk []MultiInput, overallStartIndex int, overallCount int,
	prefix string, callbacks model.ExperimentCallbacks) <-chan MultiOutput {
	outputch := make(chan MultiOutput)
	go m.collect(len(inputChunk), overallStartIndex, overallCount, prefix, callbacks, m.Run(ctx, inputChunk), outputch)
	return outputch
}
CollectOverall prints on the output channel the result of running urlgetter
on every provided input. You can use this method if you perform multiple collection
tasks within one experiment as it allows to calculate the overall progress correctly
package urlgetter
import (
	"context"
	"fmt"
	"time"
	"github.com/ooni/probe-engine/model"
)
type MultiInput struct {
	Config Config
	Target string
}
type MultiOutput struct {
	Input MultiInput
	Err error
	TestKeys TestKeys
}
type MultiGetter func(ctx context.Context, g Getter) (TestKeys, error)
func DefaultMultiGetter(ctx context.Context, g Getter) (TestKeys, error) {
	return g.Get(ctx)
}
type Multi struct {
	Begin time.Time
	Getter MultiGetter
	Parallelism int
	Session model.ExperimentSession
}
func (m Multi) Run(ctx context.Context, inputs []MultiInput) <-chan MultiOutput {
	parallelism := m.Parallelism
	if parallelism <= 0 {
		const defaultParallelism = 3
		parallelism = defaultParallelism
	}
	inputch := make(chan MultiInput)
	outputch := make(chan MultiOutput)
	go m.source(inputs, inputch)
	for i := 0; i < parallelism; i++ {
		go m.do(ctx, inputch, outputch)
	}
	return outputch
}
func (m Multi) Collect(ctx context.Context, inputs []MultiInput,
	prefix string, callbacks model.ExperimentCallbacks) <-chan MultiOutput {
	return m.CollectOverall(ctx, inputs, 0, len(inputs), prefix, callbacks)
}