paginater

package
v0.2.13-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueryPaginated

func QueryPaginated(ctx context.Context, query PaginatedQuery, offset,
	maxEvents uint64) error

QueryPaginated gets calls the paginated query function until it it has retrieved all the items from the query endpoint, or the calling context is cancelled. Note that the query function is responsible for collecting the items returned by the API (if required) so that the pagination logic can remain generic.

Types

type PaginatedQuery

type PaginatedQuery func(offset, maxEvents uint64) (uint64, uint64, error)

PaginatedQuery is a function which makes a call to a paginated api and adds returns the index offset of the last entry and the number of events that were returned.

Jump to

Keyboard shortcuts

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