githubutil

package
v0.0.0-...-5952ad4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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 some of the client functions.

func NewClient

func NewClient(token string, dryRun bool) *Client

NewClient makes a new githubutil client that does rate limiting and retries.

func (*Client) CreateStatus

func (c *Client) CreateStatus(owner, repo string, pr *github.PullRequest, status *github.RepoStatus) (*github.RepoStatus, *github.Response, error)

CreateStatus creates or updates a status context on the indicated reference. This function limits rate and does retries if needed.

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. This function limits rate, does retries if needed, and handles pagination. 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) GetCombinedStatus

func (c *Client) GetCombinedStatus(owner, repo, ref string) (*github.CombinedStatus, *github.Response, error)

GetCombinedStatus retrieves the CominedStatus for the specified reference. This function limits rate, does retries if needed and handles pagination.

type PRMungeFunc

type PRMungeFunc func(*github.PullRequest) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL