Documentation
¶
Index ¶
- type Client
- type ClientOption
- type FakeHTTP
- type Issue
- type IssueLabel
- type IssuesAndTotalCount
- type IssuesPayload
- type NotFoundError
- type PullRequest
- func CreatePullRequest(client *Client, ghRepo Repo, params map[string]interface{}) (*PullRequest, error)
- func PullRequestByNumber(client *Client, ghRepo Repo, number int) (*PullRequest, error)
- func PullRequestForBranch(client *Client, ghRepo Repo, branch string) (*PullRequest, error)
- func PullRequestList(client *Client, vars map[string]interface{}, limit int) ([]PullRequest, error)
- type PullRequestAndTotalCount
- type PullRequestChecksStatus
- type PullRequestReviewStatus
- type PullRequestsPayload
- type Repo
- type Repository
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 facilitates making HTTP requests to the GitHub API
type ClientOption ¶
type ClientOption = func(http.RoundTripper) http.RoundTripper
ClientOption represents an argument to NewClient
func AddHeader ¶
func AddHeader(name, value string) ClientOption
AddHeader turns a RoundTripper into one that adds a request header
func ReplaceTripper ¶
func ReplaceTripper(tr http.RoundTripper) ClientOption
ReplaceTripper substitutes the underlying RoundTripper with a custom one
func VerboseLog ¶
func VerboseLog(out io.Writer) ClientOption
VerboseLog enables request/response logging within a RoundTripper
type FakeHTTP ¶
type FakeHTTP struct {
// Requests stores references to sequental requests that RoundTrip has received
Requests []*http.Request
// contains filtered or unexported fields
}
FakeHTTP provides a mechanism by which to stub HTTP responses through
type Issue ¶
type Issue struct {
Number int
Title string
URL string
State string
Body string
Comments struct {
TotalCount int
}
Author struct {
Login string
}
Labels struct {
Nodes []IssueLabel
TotalCount int
}
}
func IssueCreate ¶
func IssueCreate(client *Client, repo *Repository, params map[string]interface{}) (*Issue, error)
IssueCreate creates an issue in a GitHub repository
type IssueLabel ¶
type IssueLabel struct {
Name string
}
type IssuesAndTotalCount ¶
type IssuesPayload ¶
type IssuesPayload struct {
Assigned IssuesAndTotalCount
Mentioned IssuesAndTotalCount
Authored IssuesAndTotalCount
}
func IssueStatus ¶
func IssueStatus(client *Client, ghRepo Repo, currentUsername string) (*IssuesPayload, error)
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
type PullRequest ¶
type PullRequest struct {
Number int
Title string
State string
URL string
BaseRefName string
HeadRefName string
Body string
Author struct {
Login string
}
HeadRepositoryOwner struct {
Login string
}
HeadRepository struct {
Name string
DefaultBranchRef struct {
Name string
}
}
IsCrossRepository bool
MaintainerCanModify bool
ReviewDecision string
Commits struct {
TotalCount int
Nodes []struct {
Commit struct {
StatusCheckRollup struct {
Contexts struct {
Nodes []struct {
State string
Status string
Conclusion string
}
}
}
}
}
}
}
func CreatePullRequest ¶
func CreatePullRequest(client *Client, ghRepo Repo, params map[string]interface{}) (*PullRequest, error)
func PullRequestByNumber ¶
func PullRequestByNumber(client *Client, ghRepo Repo, number int) (*PullRequest, error)
func PullRequestForBranch ¶
func PullRequestForBranch(client *Client, ghRepo Repo, branch string) (*PullRequest, error)
func PullRequestList ¶
func PullRequestList(client *Client, vars map[string]interface{}, limit int) ([]PullRequest, error)
func (*PullRequest) ChecksStatus ¶
func (pr *PullRequest) ChecksStatus() (summary PullRequestChecksStatus)
func (PullRequest) HeadLabel ¶
func (pr PullRequest) HeadLabel() string
func (*PullRequest) ReviewStatus ¶
func (pr *PullRequest) ReviewStatus() PullRequestReviewStatus
type PullRequestAndTotalCount ¶
type PullRequestAndTotalCount struct {
TotalCount int
PullRequests []PullRequest
}
type PullRequestChecksStatus ¶
type PullRequestReviewStatus ¶
type PullRequestsPayload ¶
type PullRequestsPayload struct {
ViewerCreated PullRequestAndTotalCount
ReviewRequested PullRequestAndTotalCount
CurrentPR *PullRequest
}
func PullRequests ¶
type Repository ¶
Repository contains information about a GitHub repo
func GitHubRepo ¶
func GitHubRepo(client *Client, ghRepo Repo) (*Repository, error)
GitHubRepo looks up the node ID of a named repository
Click to show internal directories.
Click to hide internal directories.