Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PullRequest ¶
type PullRequest struct {
// contains filtered or unexported fields
}
PullRequest is a comment and diff service for GitHub PullRequest.
API:
https://developer.github.com/v3/pulls/comments/#create-a-comment POST /repos/:owner/:repo/pulls/:number/comments
func NewGitHubPullRequest ¶
func NewGitHubPullRequest(cli *github.Client, owner, repo string, pr int, sha string) (*PullRequest, error)
NewGitHubPullRequest returns a new PullRequest service. PullRequest service needs git command in $PATH.
func (*PullRequest) Diff ¶
func (g *PullRequest) Diff(ctx context.Context) ([]byte, error)
Diff returns a diff of PullRequest.
func (*PullRequest) Flush ¶
func (g *PullRequest) Flush(ctx context.Context) error
Flush posts comments which has not been posted yet.
func (*PullRequest) Post ¶
Post accepts a comment and holds it. Flush method actually posts comments to GitHub in parallel.
func (*PullRequest) Strip ¶
func (g *PullRequest) Strip() int
Strip returns 1 as a strip of git diff.
Click to show internal directories.
Click to hide internal directories.