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

Method ListIssueTimelineIter

github/github-iterators.go:3603–3631  ·  view source on GitHub ↗

ListIssueTimelineIter returns an iterator that paginates through all results of ListIssueTimeline.

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

Source from the content-addressed store, hash-verified

3601
3602// ListIssueTimelineIter returns an iterator that paginates through all results of ListIssueTimeline.
3603func (s *IssuesService) ListIssueTimelineIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*Timeline, error] {
3604 return func(yield func(*Timeline, error) bool) {
3605 // Create a copy of opts to avoid mutating the caller's struct
3606 if opts == nil {
3607 opts = &ListOptions{}
3608 } else {
3609 opts = Ptr(*opts)
3610 }
3611
3612 for {
3613 results, resp, err := s.ListIssueTimeline(ctx, owner, repo, number, opts)
3614 if err != nil {
3615 yield(nil, err)
3616 return
3617 }
3618
3619 for _, item := range results {
3620 if !yield(item, nil) {
3621 return
3622 }
3623 }
3624
3625 if resp.NextPage == 0 {
3626 break
3627 }
3628 opts.Page = resp.NextPage
3629 }
3630 }
3631}
3632
3633// ListLabelsIter returns an iterator that paginates through all results of ListLabels.
3634func (s *IssuesService) ListLabelsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Label, error] {

Calls 2

ListIssueTimelineMethod · 0.95
PtrFunction · 0.70

Tested by 1