New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse Before/After Links into Response #2154
Conversation
* Some Github APIs use `before`/`after` for pagination, rather than `page` or `cursor` pagination. Parse these response values * For example, the Organizations GetAuditLog (Enterprise Cloud) https://docs.github.com/en/rest/reference/orgs#get-the-audit-log-for-an-organization With this change, pagination can be performed ```go for pageCount < PageMax { entries, resp, err := client.Organizations.GetAuditLog(ctx, "org", auditParams) if err != nil { return err } pageCount++ if resp.After == "" { break } auditParams.After = resp.After } ```
Codecov Report
@@ Coverage Diff @@
## master #2154 +/- ##
==========================================
+ Coverage 97.78% 97.79% +0.01%
==========================================
Files 112 112
Lines 9976 10036 +60
==========================================
+ Hits 9755 9815 +60
Misses 154 154
Partials 67 67
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @dghubble !
LGTM.
Awaiting second LGTM before merging.
Maybe another reviewer has time / interest? |
Perhaps @Parker77 has time? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor change, otherwise LGTM!
Co-authored-by: Parker77 <20973702+Parker77@users.noreply.github.com>
Thank you, @Parker77 ! |
before
/after
for pagination, rather thanpage
orcursor
pagination. Parse these response values into the githubResponse
With this change, pagination can be performed
Rel: #1848