MCPcopy Index your code
hub / github.com/google/go-github / ListRepositoryEventsIter

Method ListRepositoryEventsIter

github/github-iterators.go:3758–3786  ·  view source on GitHub ↗

ListRepositoryEventsIter returns an iterator that paginates through all results of ListRepositoryEvents.

(ctx context.Context, owner string, repo string, opts *ListOptions)

Source from the content-addressed store, hash-verified

3756
3757// ListRepositoryEventsIter returns an iterator that paginates through all results of ListRepositoryEvents.
3758func (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.
3789func (s *IssuesService) ListUserIssuesIter(ctx context.Context, opts *ListUserIssuesOptions) iter.Seq2[*Issue, error] {

Calls 2

ListRepositoryEventsMethod · 0.95
PtrFunction · 0.70