Version: v0.0.0-...-6850e58 Latest Latest

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 12 Imported by: 0




This section is empty.


This section is empty.


func CachePullRequestsLocally

func CachePullRequestsLocally(client *gh.Client, outputDir, repo string, input chan []*github.PullRequest, output chan OfflineStatusResponse)

func FetchPullRequests

func FetchPullRequests(client *gh.Client, repo string, input chan *github.PullRequest) error

func GetPullRequestComments

func GetPullRequestComments(client *gh.Client, owner, repoName string, number int) ([]*github.IssueComment, error)

func GetPullRequestLineComments

func GetPullRequestLineComments(client *gh.Client, owner, repoName string, number int) ([]*github.PullRequestComment, error)

func WriteMetadataFile

func WriteMetadataFile(client *gh.Client, outputDir string, repo string, pr *github.PullRequest) (string, error)

Writes a file containing metadata for

func WritePatchFile

func WritePatchFile(client *gh.Client, outputDir string, pr *github.PullRequest) (string, error)

Copies the content of the Patch URL for the PR down to a local file called <prNumber>.patch.


type Comment

type Comment struct {
	To, Name, Username, Subject, Message string
	CreatedAt                            time.Time

func (Comment) Email

func (c Comment) Email() string

type Comments

type Comments []Comment

func (Comments) Len

func (c Comments) Len() int

func (Comments) Less

func (c Comments) Less(i, j int) bool

func (Comments) Swap

func (c Comments) Swap(i, j int)

type OfflineStatusResponse

type OfflineStatusResponse struct {
	Success  bool
	Filename string
	Number   int
	Error    error

Once the PR is processed, a corresponding struct of this type is created to convey information about where the file went, whether it was successful, etc.

func WritePullRequest

func WritePullRequest(client *gh.Client, outputDir string, repo string, pr *github.PullRequest) OfflineStatusResponse

Writes a single pull request data on the local disk. It pulls down:

  1. A `.patch` file for the pull request.
  2. A metadata file, preferably in Markdown or something human-readable. - Username of author - PR reviews & comments - PR comment chain

Source Files

Jump to

Keyboard shortcuts

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