MCPcopy Create free account
hub / github.com/google/go-github / ListInstallationsIter

Method ListInstallationsIter

github/github-iterators.go:1564–1592  ·  view source on GitHub ↗

ListInstallationsIter returns an iterator that paginates through all results of ListInstallations.

(ctx context.Context, opts *ListOptions)

Source from the content-addressed store, hash-verified

1562
1563// ListInstallationsIter returns an iterator that paginates through all results of ListInstallations.
1564func (s *AppsService) ListInstallationsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Installation, error] {
1565 return func(yield func(*Installation, error) bool) {
1566 // Create a copy of opts to avoid mutating the caller's struct
1567 if opts == nil {
1568 opts = &ListOptions{}
1569 } else {
1570 opts = Ptr(*opts)
1571 }
1572
1573 for {
1574 results, resp, err := s.ListInstallations(ctx, opts)
1575 if err != nil {
1576 yield(nil, err)
1577 return
1578 }
1579
1580 for _, item := range results {
1581 if !yield(item, nil) {
1582 return
1583 }
1584 }
1585
1586 if resp.NextPage == 0 {
1587 break
1588 }
1589 opts.Page = resp.NextPage
1590 }
1591 }
1592}
1593
1594// ListReposIter returns an iterator that paginates through all results of ListRepos.
1595func (s *AppsService) ListReposIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Repository, error] {

Calls 2

ListInstallationsMethod · 0.95
PtrFunction · 0.70