ListCombinedStatusIter returns an iterator that paginates through all results of GetCombinedStatus.
(ctx context.Context, owner string, repo string, ref string, opts *ListOptions)
| 5454 | |
| 5455 | // ListCombinedStatusIter returns an iterator that paginates through all results of GetCombinedStatus. |
| 5456 | func (s *RepositoriesService) ListCombinedStatusIter(ctx context.Context, owner string, repo string, ref string, opts *ListOptions) iter.Seq2[*RepoStatus, error] { |
| 5457 | return func(yield func(*RepoStatus, error) bool) { |
| 5458 | // Create a copy of opts to avoid mutating the caller's struct |
| 5459 | if opts == nil { |
| 5460 | opts = &ListOptions{} |
| 5461 | } else { |
| 5462 | opts = Ptr(*opts) |
| 5463 | } |
| 5464 | |
| 5465 | for { |
| 5466 | results, resp, err := s.GetCombinedStatus(ctx, owner, repo, ref, opts) |
| 5467 | if err != nil { |
| 5468 | yield(nil, err) |
| 5469 | return |
| 5470 | } |
| 5471 | |
| 5472 | var iterItems []*RepoStatus |
| 5473 | if results != nil { |
| 5474 | iterItems = results.Statuses |
| 5475 | } |
| 5476 | for _, item := range iterItems { |
| 5477 | if !yield(item, nil) { |
| 5478 | return |
| 5479 | } |
| 5480 | } |
| 5481 | |
| 5482 | if resp.NextPage == 0 { |
| 5483 | break |
| 5484 | } |
| 5485 | opts.Page = resp.NextPage |
| 5486 | } |
| 5487 | } |
| 5488 | } |
| 5489 | |
| 5490 | // ListCommitFilesIter returns an iterator that paginates through all results of GetCommit. |
| 5491 | func (s *RepositoriesService) ListCommitFilesIter(ctx context.Context, owner string, repo string, sha string, opts *ListOptions) iter.Seq2[*CommitFile, error] { |