Documentation ¶
Overview ¶
Package ghclient provides a github client that wraps go-github with retry logic, rate limiting, and depagination where necessary.
Index ¶
- type Client
- func (c *Client) CreateIssue(org, repo, title, body string, labels, assignees []string) (*github.Issue, error)
- func (c *Client) CreateStatus(owner, repo, ref string, status *github.RepoStatus) (*github.RepoStatus, error)
- func (c *Client) ForEachPR(owner, repo string, opts *github.PullRequestListOptions, continueOnError bool, ...) error
- func (c *Client) GetCollaborators(org, repo string) ([]*github.User, error)
- func (c *Client) GetCombinedStatus(owner, repo, ref string) (*github.CombinedStatus, error)
- func (c *Client) GetIssues(org, repo string, opts *github.IssueListByRepoOptions) ([]*github.Issue, error)
- func (c *Client) GetRepoLabels(org, repo string) ([]*github.Label, error)
- func (c *Client) GetUser(login string) (*github.User, error)
- type PRMungeFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an augmentation of the go-github client that adds retry logic, rate limiting, and pagination handling to applicable the client functions.
func (*Client) CreateIssue ¶
func (c *Client) CreateIssue(org, repo, title, body string, labels, assignees []string) (*github.Issue, error)
CreateIssue tries to create and return a new github issue.
func (*Client) CreateStatus ¶
func (c *Client) CreateStatus(owner, repo, ref string, status *github.RepoStatus) (*github.RepoStatus, error)
CreateStatus creates or updates a status context on the indicated reference.
func (*Client) ForEachPR ¶
func (c *Client) ForEachPR(owner, repo string, opts *github.PullRequestListOptions, continueOnError bool, mungePR PRMungeFunc) error
ForEachPR iterates over all PRs that fit the specified criteria, calling the munge function on every PR. If the munge function returns a non-nil error, ForEachPR will return immediately with a non-nil error unless continueOnError is true in which case an error will be logged and the remaining PRs will be munged.
func (*Client) GetCollaborators ¶
GetCollaborators returns all github users who are members or outside collaborators of the repo.
func (*Client) GetCombinedStatus ¶
func (c *Client) GetCombinedStatus(owner, repo, ref string) (*github.CombinedStatus, error)
GetCombinedStatus retrieves the CombinedStatus for the specified reference.
func (*Client) GetIssues ¶
func (c *Client) GetIssues(org, repo string, opts *github.IssueListByRepoOptions) ([]*github.Issue, error)
GetIssues gets all the issues in a repo that meet the list options.
func (*Client) GetRepoLabels ¶
GetRepoLabels gets all the labels that valid in the specified repo.
type PRMungeFunc ¶
type PRMungeFunc func(*github.PullRequest) error