Documentation
¶
Index ¶
- func SliceChunksOfSize[T any](items []T, chunkSize int) (chunks [][]T)
- func SliceIterator[T any](items []T) *sliceIterator[T]
- func SliceNChunks[T any](items []T, numChunks int) (chunks [][]T)
- func WithChunksOfSize[T any](items []T, chunkSize int, handler ChunkHandler[T]) (err error)
- func WithNChunks[T any](items []T, numChunks int, handler ChunkHandler[T]) (err error)
- type ChunkHandler
- type IFilter
- type ITransform
- type Iterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SliceChunksOfSize ¶ added in v0.12.0
Break a slice into multiple slices of the provided size. The last chunk may be smaller than the others.
func SliceIterator ¶ added in v0.12.0
func SliceIterator[T any](items []T) *sliceIterator[T]
func SliceNChunks ¶ added in v0.12.0
Break a slice into N slices of approximately equal size. The last chunk may be smaller than the others.
func WithChunksOfSize ¶ added in v0.12.0
func WithChunksOfSize[T any](items []T, chunkSize int, handler ChunkHandler[T]) (err error)
Run the handler on each chunk with a maximum size of chunkSize. The last chunk may be smaller than the others.
func WithNChunks ¶ added in v0.12.0
func WithNChunks[T any](items []T, numChunks int, handler ChunkHandler[T]) (err error)
Run the handler N times with chunks of approximately equal size. The last chunk may be smaller than the others.
Types ¶
type ChunkHandler ¶
type ITransform ¶ added in v0.12.0
Click to show internal directories.
Click to hide internal directories.