Documentation ¶ Index ¶ func Batch[T any](batchSize int, data []T, eachFn func([]T) error) error func BatchMap[T any](batchSize int, data map[string][]T, eachFn func(map[string][]T) error) error Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Batch ¶ func Batch[T any](batchSize int, data []T, eachFn func([]T) error) error Batch splits values in `data` in batches of size `batchSize`, and calls `eachFn` for each batch. func BatchMap ¶ func BatchMap[T any](batchSize int, data map[string][]T, eachFn func(map[string][]T) error) error BatchMap splits values in `data` in batches of size `batchSize`, and calls `eachFn` for each batch. Values of a specific key may be split into different batches, make sure `eachFn` can handle that case. Types ¶ This section is empty. Source Files ¶ View all Source files batch.go Click to show internal directories. Click to hide internal directories.