-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add support for listing and getting repository/organization webhook deliveries #1934
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
Changes from all commits
54e5502
f5889f8
f6d688a
ff5a47a
dffbb1c
5f0e1e4
431c77c
23922a8
72c3380
5b86aff
194eff6
1381c0f
0a3739c
fc8d20f
123bafa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -212,6 +212,9 @@ type ListCursorOptions struct { | |
|
||
// A cursor, as given in the Link header. If specified, the query only searches for events before this cursor. | ||
Before string `url:"before,omitempty"` | ||
|
||
// A cursor, as given in the Link header. If specified, the query continues the search using this cursor. | ||
Cursor string `url:"cursor,omitempty"` | ||
} | ||
|
||
// UploadOptions specifies the parameters to methods that support uploads. | ||
|
@@ -445,6 +448,11 @@ type Response struct { | |
// calling the endpoint again. | ||
NextPageToken string | ||
|
||
// For APIs that support cursor pagination, such as RepositoryService.ListRepositoryHookDeliveries, | ||
// the following field will be populated to point to the next page. | ||
// Set ListCursorOptions.Cursor to this value when calling the endpoint again. | ||
Cursor string | ||
|
||
// Explicitly specify the Rate type so Rate's String() receiver doesn't | ||
// propagate to Response. | ||
Rate Rate | ||
|
@@ -481,7 +489,21 @@ func (r *Response) populatePageValues() { | |
if err != nil { | ||
continue | ||
} | ||
page := url.Query().Get("page") | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm... I'm not sure I'm happy with this section (especially regarding increasing the already-deep indentation levels). Since q := url.Query()
if cursor := q.Get("cursor"); cursor != "" {
...
}
page := q.Get("page")
if page == "" {
continue
}
... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Addressed in f6d688a |
||
q := url.Query() | ||
|
||
if cursor := q.Get("cursor"); cursor != "" { | ||
for _, segment := range segments[1:] { | ||
switch strings.TrimSpace(segment) { | ||
case `rel="next"`: | ||
r.Cursor = cursor | ||
} | ||
} | ||
|
||
continue | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are If so, do you want to add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Yes, I believe so, although it isn't documented anywhere. Added |
||
|
||
page := q.Get("page") | ||
if page == "" { | ||
continue | ||
} | ||
|
@@ -499,7 +521,6 @@ func (r *Response) populatePageValues() { | |
case `rel="last"`: | ||
r.LastPage, _ = strconv.Atoi(page) | ||
} | ||
|
||
} | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.