ListRepositoryEventsIter returns an iterator that paginates through all results of ListRepositoryEvents.
(ctx context.Context, owner string, repo string, opts *ListOptions)
| 3756 | |
| 3757 | // ListRepositoryEventsIter returns an iterator that paginates through all results of ListRepositoryEvents. |
| 3758 | func (s *IssuesService) ListRepositoryEventsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*IssueEvent, error] { |
| 3759 | return func(yield func(*IssueEvent, error) bool) { |
| 3760 | // Create a copy of opts to avoid mutating the caller's struct |
| 3761 | if opts == nil { |
| 3762 | opts = &ListOptions{} |
| 3763 | } else { |
| 3764 | opts = Ptr(*opts) |
| 3765 | } |
| 3766 | |
| 3767 | for { |
| 3768 | results, resp, err := s.ListRepositoryEvents(ctx, owner, repo, opts) |
| 3769 | if err != nil { |
| 3770 | yield(nil, err) |
| 3771 | return |
| 3772 | } |
| 3773 | |
| 3774 | for _, item := range results { |
| 3775 | if !yield(item, nil) { |
| 3776 | return |
| 3777 | } |
| 3778 | } |
| 3779 | |
| 3780 | if resp.NextPage == 0 { |
| 3781 | break |
| 3782 | } |
| 3783 | opts.Page = resp.NextPage |
| 3784 | } |
| 3785 | } |
| 3786 | } |
| 3787 | |
| 3788 | // ListUserIssuesIter returns an iterator that paginates through all results of ListUserIssues. |
| 3789 | func (s *IssuesService) ListUserIssuesIter(ctx context.Context, opts *ListUserIssuesOptions) iter.Seq2[*Issue, error] { |