ListIssueReactionsIter returns an iterator that paginates through all results of ListIssueReactions.
(ctx context.Context, owner string, repo string, number int, opts *ListReactionOptions)
| 5264 | |
| 5265 | // ListIssueReactionsIter returns an iterator that paginates through all results of ListIssueReactions. |
| 5266 | func (s *ReactionsService) ListIssueReactionsIter(ctx context.Context, owner string, repo string, number int, opts *ListReactionOptions) iter.Seq2[*Reaction, error] { |
| 5267 | return func(yield func(*Reaction, error) bool) { |
| 5268 | // Create a copy of opts to avoid mutating the caller's struct |
| 5269 | if opts == nil { |
| 5270 | opts = &ListReactionOptions{} |
| 5271 | } else { |
| 5272 | opts = Ptr(*opts) |
| 5273 | } |
| 5274 | |
| 5275 | for { |
| 5276 | results, resp, err := s.ListIssueReactions(ctx, owner, repo, number, opts) |
| 5277 | if err != nil { |
| 5278 | yield(nil, err) |
| 5279 | return |
| 5280 | } |
| 5281 | |
| 5282 | for _, item := range results { |
| 5283 | if !yield(item, nil) { |
| 5284 | return |
| 5285 | } |
| 5286 | } |
| 5287 | |
| 5288 | if resp.NextPage == 0 { |
| 5289 | break |
| 5290 | } |
| 5291 | opts.ListOptions.Page = resp.NextPage |
| 5292 | } |
| 5293 | } |
| 5294 | } |
| 5295 | |
| 5296 | // ListPullRequestCommentReactionsIter returns an iterator that paginates through all results of ListPullRequestCommentReactions. |
| 5297 | func (s *ReactionsService) ListPullRequestCommentReactionsIter(ctx context.Context, owner string, repo string, id int64, opts *ListReactionOptions) iter.Seq2[*Reaction, error] { |