Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var EndOfList = fmt.Errorf("EndOfList")
Functions ¶
Types ¶
type ListGenerator ¶
type ListGenerator[ItemType any] struct { // Retrieve should call the github client with the provided ListOptions // to retrieve the next page. Retrieve func(github.ListOptions) ([]*ItemType, *github.Response, error) // contains filtered or unexported fields }
ListGenerator handles logic for iterating through github client paged lists.
func (*ListGenerator[GithubType]) HasNext ¶
func (g *ListGenerator[GithubType]) HasNext() bool
HasNext Returns true when the next item in the list exists.
func (*ListGenerator[GithubType]) Next ¶
func (g *ListGenerator[GithubType]) Next() (*GithubType, error)
Next returns the next item in the list or error if the next page cannot be retrieved or there are no more items.
type PagedListGenerator ¶
type PagedListGenerator[GithubType any, ItemType any] struct { // Retrieve should call the github client with the provided ListOptions // to retrieve the next page. Retrieve func(github.ListOptions) (*GithubType, []*ItemType, *github.Response, error) // contains filtered or unexported fields }
PagedListGenerator handles logic for iterating through a Github Client paged list where your code needs both the page object and the item object. GithubType is the page object, ItemType is the item object.
func (*PagedListGenerator[GithubType, ItemType]) HasNext ¶
func (g *PagedListGenerator[GithubType, ItemType]) HasNext() bool
HasNext returns true when there are more items in the list.
func (*PagedListGenerator[GithubType, ItemType]) Next ¶
func (g *PagedListGenerator[GithubType, ItemType]) Next() (*GithubType, *ItemType, error)
Next returns a pointer the next item in the list, along with a pointer to the current page. Returns error when the end of the list is reached, or when there was a problem retrieving the next page.