ghclient

package
v0.0.0-...-7a2065e Latest Latest
Warning

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

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

Documentation

Overview

Package ghclient provides a github client that wraps go-github with retry logic, rate limiting, and depagination where necessary.

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

func NewClient

func NewClient(token string, dryRun bool) *Client

NewClient makes a new Client with the specified token and dry-run status.

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

func (c *Client) GetCollaborators(org, repo string) ([]*github.User, error)

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

func (c *Client) GetRepoLabels(org, repo string) ([]*github.Label, error)

GetRepoLabels gets all the labels that valid in the specified repo.

func (*Client) GetUser

func (c *Client) GetUser(login string) (*github.User, error)

GetUser gets the github user with the specified login or the currently authenticated user. To get the currently authenticated user specify a login of "".

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