An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

github.com/tmobile/depaginator

Package depaginator contains an implementation of a function, Depaginate, that allows iterating over all items in a paginated API. The consuming application needs to pass Depaginate a context.Context, a PageGetter page retriever, and an item Handler, then call Depaginator.Wait on the result; the Depaginator will then take care of the rest, calling the [PageGetter.GetPage] method to retrieve pages of results and the [Handler.Handle] method to handle the found items. Options exist to call a [Starter.Start] method before beginning, [Updater.Update] method when the total number of pages or items is discovered; and [Doner.Done] when the iteration is complete.

Ecosystem
proxy.golang.org
Latest Release
v0.4.0
4 months ago
Versions
5
Links
Registry proxy.golang.org
Source Repository
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:golang/github.com/tmobile/depaginator
spec
License Apache-2.0
Namespace github.com/tmobile
First Release almost 5 years ago
Last Synced 16 days ago
Repository
Stars 2 on GitHub
Forks 3 on GitHub
Rankings on proxy.golang.org
Overall Top 8.6%
Forks Top 9.0%