ListContributorsIter returns an iterator that paginates through all results of ListContributors.
(ctx context.Context, owner string, repository string, opts *ListContributorsOptions)
| 5869 | |
| 5870 | // ListContributorsIter returns an iterator that paginates through all results of ListContributors. |
| 5871 | func (s *RepositoriesService) ListContributorsIter(ctx context.Context, owner string, repository string, opts *ListContributorsOptions) iter.Seq2[*Contributor, error] { |
| 5872 | return func(yield func(*Contributor, error) bool) { |
| 5873 | // Create a copy of opts to avoid mutating the caller's struct |
| 5874 | if opts == nil { |
| 5875 | opts = &ListContributorsOptions{} |
| 5876 | } else { |
| 5877 | opts = Ptr(*opts) |
| 5878 | } |
| 5879 | |
| 5880 | for { |
| 5881 | results, resp, err := s.ListContributors(ctx, owner, repository, opts) |
| 5882 | if err != nil { |
| 5883 | yield(nil, err) |
| 5884 | return |
| 5885 | } |
| 5886 | |
| 5887 | for _, item := range results { |
| 5888 | if !yield(item, nil) { |
| 5889 | return |
| 5890 | } |
| 5891 | } |
| 5892 | |
| 5893 | if resp.NextPage == 0 { |
| 5894 | break |
| 5895 | } |
| 5896 | opts.ListOptions.Page = resp.NextPage |
| 5897 | } |
| 5898 | } |
| 5899 | } |
| 5900 | |
| 5901 | // ListCustomDeploymentRuleIntegrationsIter returns an iterator that paginates through all results of ListCustomDeploymentRuleIntegrations. |
| 5902 | func (s *RepositoriesService) ListCustomDeploymentRuleIntegrationsIter(ctx context.Context, owner string, repo string, environment string, opts *ListOptions) iter.Seq2[*CustomDeploymentProtectionRuleApp, error] { |