github

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubPullRequest

type GitHubPullRequest struct {
	// contains filtered or unexported fields
}

GitHubPullRequest 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) (*GitHubPullRequest, error)

NewGitHubPullRequest returns a new GitHubPullRequest service. GitHubPullRequest service needs git command in $PATH.

func (*GitHubPullRequest) Diff

func (g *GitHubPullRequest) Diff(ctx context.Context) ([]byte, error)

Diff returns a diff of PullRequest.

func (*GitHubPullRequest) Flush

func (g *GitHubPullRequest) Flush(ctx context.Context) error

Flush posts comments which has not been posted yet.

func (*GitHubPullRequest) Post

Post accepts a comment and holds it. Flush method actually posts comments to GitHub in parallel.

func (*GitHubPullRequest) Strip

func (g *GitHubPullRequest) Strip() int

Strip returns 1 as a strip of git diff.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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