The iam package is very foundational, and now depends
on the pagination package. Thus, the pagination package
must not import any packages that may import iam,
such as the plugin package. Move the plugin helpers
to a subdirectory to avoid this import cycle.
These new methods can be used in places where the caller wants
to automatically paginate over a resource that is returned
together with a slice of plugins, such as host catalogs.
These new methods can be used in places where the caller wants
to automatically paginate over a resource that is returned
together with a plugin, such as plugin hosts, host sets and storage buckets.
The new design defines 4 distinct functions, List, ListPage, ListRefresh
and ListRefreshPage. The first two are used during the initial
pagination, and the other two are used during refreshing.
The pagination package provides generic functions for
iterating over a collection of items such that each incoming
request is filled even after filtering is applied.