gh

package
v0.0.0-...-25a8327 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 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 {
	sync.Mutex
	*github.Client
	// contains filtered or unexported fields
}

Client refers to a client which wishes to connect to specific repository of a user.

func NewClient

func NewClient(owner, repo, token string) *Client

NewClient constructs a new instance of Client.

func (*Client) AddCommentToIssue

func (c *Client) AddCommentToIssue(num int, comment *github.IssueComment) error

AddCommentToIssue adds comment to an issue.

func (*Client) AddCommentToPR

func (c *Client) AddCommentToPR(num int, comment *github.IssueComment) error

AddCommentToPR adds comment to a pull request.

func (*Client) AddLabelsToIssue

func (c *Client) AddLabelsToIssue(num int, labels []string) error

AddLabelsToIssue adds labels to an issue

func (*Client) AssignIssueToUsers

func (c *Client) AssignIssueToUsers(num int, users []string) error

AssignIssueToUsers assigns users to the specified issue.

func (*Client) CreateIssue

func (c *Client) CreateIssue(title, body string) error

CreateIssue creates a brand new issue in repo's issue list.

func (*Client) CreatePR

func (c *Client) CreatePR(newPR *github.NewPullRequest) (*github.PullRequest, error)

CreatePR creates a brand new pull request in repo.

func (*Client) EditIssue

func (c *Client) EditIssue(number int, issue *github.IssueRequest) error

EditIssue edit a specific issue

func (*Client) GetAllLabels

func (c *Client) GetAllLabels() ([]*github.Label, error)

GetAllLabels gets all labels of a repo, not an issue, nor a pull request

func (*Client) GetIssues

func (c *Client) GetIssues(opt *github.IssueListByRepoOptions) ([]*github.Issue, error)

GetIssues gets issues of a repo.

func (*Client) GetLabelsInIssue

func (c *Client) GetLabelsInIssue(num int) ([]*github.Label, error)

GetLabelsInIssue gets labels attached on a single issue whose id is num.

func (*Client) GetPullRequests

func (c *Client) GetPullRequests(opt *github.PullRequestListOptions) ([]*github.PullRequest, error)

GetPullRequests gets pull request list for a repo.

func (*Client) GetRepository

func (c *Client) GetRepository() (*github.Repository, error)

GetRepository gets a repository.

func (*Client) GetSinglePR

func (c *Client) GetSinglePR(num int) (*github.PullRequest, error)

GetSinglePR gets a single PR from repo.

func (*Client) GetStrLabelsInIssue

func (c *Client) GetStrLabelsInIssue(num int) ([]string, error)

GetStrLabelsInIssue gets string labels attached on a single issue whose id is num.

func (*Client) IssueContainsLabels

func (c *Client) IssueContainsLabels(num int, labels []string) bool

IssueContainsLabels return whether issue contains labels

func (*Client) IssueHasComment

func (c *Client) IssueHasComment(num int, element string) (int, bool)

IssueHasComment returns true if the issue contains a commnet who has substring of 'elment'

func (*Client) IssueHasLabel

func (c *Client) IssueHasLabel(num int, inputLabel string) bool

IssueHasLabel judges if an issue has a specified label.

func (*Client) ListComments

func (c *Client) ListComments(num int) ([]*github.IssueComment, error)

ListComments lists all comments in an issue including pull request.

func (*Client) ListCommits

func (c *Client) ListCommits(num int) ([]*github.RepositoryCommit, error)

ListCommits lists all commits in a pull request.

func (*Client) ListContributors

func (c *Client) ListContributors(opt *github.ListContributorsOptions) ([]*github.Contributor, error)

ListContributors lists all contributors of a repository.

func (*Client) ListPRComments

func (c *Client) ListPRComments(num int) ([]*github.PullRequestComment, error)

ListPRComments lists comments for a pull request.

func (*Client) ListPRReviews

func (c *Client) ListPRReviews(num int) ([]*github.PullRequestReview, error)

ListPRReviews lists all reviews on a pull request.

func (*Client) Owner

func (c *Client) Owner() string

Owner returns owner of client.

func (*Client) RemoveComment

func (c *Client) RemoveComment(id int) error

RemoveComment removes a comment for an issue.

func (*Client) RemoveLabelForIssue

func (c *Client) RemoveLabelForIssue(num int, label string) error

RemoveLabelForIssue removes a label from an issue.

func (*Client) ReplaceLabelsForIssue

func (c *Client) ReplaceLabelsForIssue(num int, labels []string) error

ReplaceLabelsForIssue replaces all labels for an issue.

func (*Client) Repo

func (c *Client) Repo() string

Repo returns repo name of client.

func (*Client) RmCommentsViaStr

func (c *Client) RmCommentsViaStr(num int, str string) error

RmCommentsViaStr removes a comment in an issue via given string

func (*Client) RmCommentsViaStrAndAttach

func (c *Client) RmCommentsViaStrAndAttach(num int, str string, body string) error

RmCommentsViaStrAndAttach removes all comments contains the string str and attaches a brand new commnet constructed by body. In this robot, many cases needs this actions to fresh the comments.

func (*Client) SearchIssues

func (c *Client) SearchIssues(query string, opt *github.SearchOptions, all bool) (*github.IssuesSearchResult, error)

SearchIssues searches issues. search result's wrapper is never be nil.

func (*Client) UnassignIssueToUsers

func (c *Client) UnassignIssueToUsers(num int, users []string) error

UnassignIssueToUsers assigns users to the specified issue.

Jump to

Keyboard shortcuts

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