Help us shape the future of Go! Take the 2026 Go Developer Survey

batch

package
v0.19.1255 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchFetch

func BatchFetch[T any](
	ctx context.Context,
	pageSize int,
	maxItems int,
	fetchFn func(ctx context.Context, offset, limit int) ([]T, bool, error),
) ([]T, error)

BatchFetch is a generic function to handle pagination with offset/limit pattern. It takes a callback function that will be called with each page's limit, and returns both the items for that page and a boolean indicating if there are more items.

Types

This section is empty.

Jump to

Keyboard shortcuts

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