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.
Click to show internal directories.
Click to hide internal directories.