github

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 13 Imported by: 0

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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