Documentation
¶
Index ¶
Constants ¶
const PullRequestsURL = "https://api.github.com"
PullRequestsURL is the Github API URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commit ¶
type Commit struct { SHA string Author User CommitDetails `json:"commit"` UpdatedAt string `json:"updated_at"` }
Commit from a PR
type CommitDetails ¶
type CommitDetails struct {
Message string
}
CommitDetails are extra details for the commit
type Error ¶
type Error struct { Message string Errors []*ErrorMessage }
Error shows feedback from the API
type MergeStatus ¶
type MergeStatus struct { SHA string `json:"sha"` Merged bool `json:"merged"` Message string `json:"message"` }
MergeStatus shows the status of a merge request
func MergePullRequest ¶
func MergePullRequest(repo string, number int, title, message, method string) (*MergeStatus, error)
MergePullRequest will merge an existing pull request
type NewPullRequest ¶
type NewPullRequest struct { Title string `json:"title"` Body string `json:"body"` Head string `json:"head"` Base string `json:"base"` }
NewPullRequest is used when opening a new pull request
type PatchPullRequest ¶
type PatchPullRequest struct { Title string `json:"title"` Body string `json:"body"` State string `json:"state"` Base string `json:"base"` }
PatchPullRequest is used to update a PR
type PullRequest ¶
type PullRequest struct { Number int State string Locked bool Title string Body string StatusesURL string `json:"statuses_url"` HTMLUrl string `json:"html_url"` User User CreatedAt time.Time `json:"created_at"` MergedAt time.Time `json:"merged_at"` MergeCommitSha string `json:"merge_commit_sha"` Head Head Base Base RequestedReviewers Users `json:"requested_reviewers"` Mergeable bool Rebaseable bool MergeableState string `json:"mergeable_state"` MergedBy User `json:"merged_by"` Commits int Additions int Deletions int ChangedFiles int `json:"changed_files"` }
PullRequest represents a single pull request
func CreatePullRequest ¶
func CreatePullRequest(repo, title, body, head, base string) (*PullRequest, error)
CreatePullRequest opens a new pull request
func GetPullRequest ¶
func GetPullRequest(repo string, number int) (*PullRequest, error)
GetPullRequest returns a single pull request given a repo and a number
func UpdatePullRequest ¶
func UpdatePullRequest(repo string, number int, title, body, state, base string) (*PullRequest, error)
UpdatePullRequest updates an existing pull request
type PullRequestsResult ¶
type PullRequestsResult struct {
PullRequests []*PullRequest
}
PullRequestsResult represents a collection of PullRequests
func ListPullRequests ¶
func ListPullRequests(repo string, allIssues bool) (*PullRequestsResult, error)
ListPullRequests returns all pull requests for a repo https://developer.github.com/v3/pulls/#list-pull-requests