Support For Limiting Auto-Pagination Depth
tyler-domitrovich opened this issue · 5 comments
It would be nice to be able to limit how many pages of results are returned. Consider the case where we want to retrieve the most recent 20 commits for the main branch of a very active repository. Currently, the auto-pagination will recurse through all pages of results which is time consuming and unnecessary since we would have all of the results we require for this example after the first couple of pages.
FYI I was able to get a rough pass of this behavior working in my fork here:
https://github.com/tyler-domitrovich/go-bitbucket/tree/adjustable-pagination-depth
If you have any interest in this feature let me know and I will create a PR!
Umm.. DEFAULT_PAGE_LENGTH
is not enough?
https://github.com/ktrysmt/go-bitbucket/blob/master/client.go#L24
I don't believe so. It looks like DEFAULT_PAGE_LENGTH
is used to set pagelen
, which does allow us to change the number of results returned per page, but does not allow us to change the number of pages returned so we still will recurse through every page of results available.