Documentation ¶
Index ¶
- func BindPATFlag() *string
- func BindRepoFlag() *string
- func FetchEachPage(f func(options github.ListOptions) (*github.Response, error)) error
- func NewClient(ctx context.Context, pat string) (*github.Client, error)
- func ParseRepoFlag(repo *string) (owner, name string, err error)
- func Retry(f func() error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindPATFlag ¶
func BindPATFlag() *string
BindPATFlag returns a flag to specify the personal access token.
func BindRepoFlag ¶
func BindRepoFlag() *string
BindRepoFlag returns a flag to specify a GitHub repo to target. Parse it with ParseRepoFlag.
func FetchEachPage ¶
FetchEachPage helps fetch all data from a GitHub API call that may or may not span multiple pages. FetchEachPage initially calls f with no paging parameters, then inspects the GitHub response to see if there are more pages to fetch. If so, it constructs paging parameters that will fetch the next page and calls f again. This repeats until there aren't any more pages.
Note that FetchEachPage doesn't process any of the result data, and doesn't actually call the GitHub API. f must do this itself. This allows FetchEachPage to work with any GitHub API.
func ParseRepoFlag ¶
ParseRepoFlag splits a given repo (owner/name) into owner and name, or returns an error.
Types ¶
This section is empty.