Documentation
¶
Index ¶
- Variables
- func GetPullRequestBaseOwnerName(pullRequest *github.PullRequest) string
- func GetPullRequestBaseRepoName(pullRequest *github.PullRequest) string
- func GetPullRequestHeadOwnerName(pullRequest *github.PullRequest) string
- func GetPullRequestHeadRepoName(pullRequest *github.PullRequest) string
- func GetPullRequestNumber(pullRequest *github.PullRequest) int
- func PaginatedRequest(initFn func() interface{}, ...) (interface{}, error)
- func ParseNumPages(resp *github.Response) int
- func ParseNumPagesFromLink(link string) int
- type FieldDetails
- type FieldNode
- type Fields
- type GQLReviewThread
- type GithubClient
- func (c *GithubClient) AddAssignees(ctx context.Context, owner string, repo string, number int, assignees []string) (*github.Issue, *github.Response, error)
- func (c *GithubClient) AddLabels(ctx context.Context, owner string, repo string, number int, labels []string) ([]*github.Label, *github.Response, error)
- func (c *GithubClient) CreateComment(ctx context.Context, owner string, repo string, number int, ...) (*github.IssueComment, *github.Response, error)
- func (c *GithubClient) CreateLabel(ctx context.Context, owner string, repo string, label *github.Label) (*github.Label, *github.Response, error)
- func (c *GithubClient) DeleteComment(ctx context.Context, owner string, repo string, commentId int64) (*github.Response, error)
- func (c *GithubClient) DownloadContents(ctx context.Context, filePath string, branch *github.PullRequestBranch) ([]byte, error)
- func (c *GithubClient) EditComment(ctx context.Context, owner string, repo string, commentId int64, ...) (*github.IssueComment, *github.Response, error)
- func (c *GithubClient) EditIssue(ctx context.Context, owner string, repo string, number int, ...) (*github.Issue, *github.Response, error)
- func (c *GithubClient) EditPullRequest(ctx context.Context, owner string, repo string, number int, ...) (*github.PullRequest, *github.Response, error)
- func (c *GithubClient) GetClientGraphQL() *githubv4.Client
- func (c *GithubClient) GetClientREST() *github.Client
- func (c *GithubClient) GetComments(ctx context.Context, owner string, repo string, number int, ...) ([]*github.IssueComment, error)
- func (c *GithubClient) GetDefaultRepositoryBranch(ctx context.Context, owner string, repo string) (string, error)
- func (c *GithubClient) GetIssue(ctx context.Context, owner, repo string, number int) (*github.Issue, *github.Response, error)
- func (c *GithubClient) GetIssueTimeline(ctx context.Context, owner string, repo string, number int) ([]*github.Timeline, error)
- func (c *GithubClient) GetIssuesAvailableAssignees(ctx context.Context, owner string, repo string) ([]*github.User, error)
- func (c *GithubClient) GetLabel(ctx context.Context, owner string, repo string, name string) (*github.Label, *github.Response, error)
- func (c *GithubClient) GetProjectFieldsByProjectNumber(ctx context.Context, owner, repo string, projectNumber uint64, retryCount int) ([]FieldNode, error)
- func (c *GithubClient) GetProjectV2ByName(ctx context.Context, owner, repo, name string) (*ProjectV2, error)
- func (c *GithubClient) GetPullRequest(ctx context.Context, owner string, repo string, number int) (*github.PullRequest, *github.Response, error)
- func (c *GithubClient) GetPullRequestClosingIssuesCount(ctx context.Context, owner string, repo string, number int) (int, error)
- func (c *GithubClient) GetPullRequestCommits(ctx context.Context, owner string, repo string, number int) ([]*github.RepositoryCommit, error)
- func (c *GithubClient) GetPullRequestFiles(ctx context.Context, owner string, repo string, number int) ([]*github.CommitFile, error)
- func (c *GithubClient) GetPullRequestReviewers(ctx context.Context, owner string, repo string, number int, ...) (*github.Reviewers, error)
- func (c *GithubClient) GetPullRequestReviews(ctx context.Context, owner string, repo string, number int) ([]*github.PullRequestReview, error)
- func (c *GithubClient) GetPullRequests(ctx context.Context, owner string, repo string) ([]*github.PullRequest, error)
- func (c *GithubClient) GetRepoCollaborators(ctx context.Context, owner string, repo string) ([]*github.User, error)
- func (c *GithubClient) GetRepositoryBranch(ctx context.Context, owner string, repo string, branch string, ...) (*github.Branch, *github.Response, error)
- func (c *GithubClient) GetReviewThreads(ctx context.Context, owner string, repo string, number int, retryCount int) ([]GQLReviewThread, error)
- func (c *GithubClient) ListCheckRunsForRef(ctx context.Context, owner string, repo string, ref string, ...) (*github.ListCheckRunsResults, *github.Response, error)
- func (c *GithubClient) ListIssuesByRepo(ctx context.Context, owner string, repo string, ...) ([]*github.Issue, *github.Response, error)
- func (c *GithubClient) ListOrganizationMembers(ctx context.Context, org string, opts *github.ListMembersOptions) ([]*github.User, *github.Response, error)
- func (c *GithubClient) ListTeamMembersBySlug(ctx context.Context, org string, slug string, ...) ([]*github.User, *github.Response, error)
- func (c *GithubClient) Merge(ctx context.Context, owner string, repo string, number int, ...) (*github.PullRequestMergeResult, *github.Response, error)
- func (c *GithubClient) RemoveLabelForIssue(ctx context.Context, owner string, repo string, number int, label string) (*github.Response, error)
- func (c *GithubClient) RequestReviewers(ctx context.Context, owner string, repo string, number int, ...) (*github.PullRequest, *github.Response, error)
- type PageInfo
- type ProjectV2
- type ReviewThreadsQuery
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrProjectNotFound = errors.New("project not found")
)
Functions ¶
func GetPullRequestBaseOwnerName ¶
func GetPullRequestBaseOwnerName(pullRequest *github.PullRequest) string
func GetPullRequestBaseRepoName ¶
func GetPullRequestBaseRepoName(pullRequest *github.PullRequest) string
func GetPullRequestHeadOwnerName ¶
func GetPullRequestHeadOwnerName(pullRequest *github.PullRequest) string
func GetPullRequestHeadRepoName ¶
func GetPullRequestHeadRepoName(pullRequest *github.PullRequest) string
func GetPullRequestNumber ¶
func GetPullRequestNumber(pullRequest *github.PullRequest) int
func PaginatedRequest ¶
func ParseNumPages ¶
ParseNumPages Given a link header string representing pagination info, returns total number of pages.
func ParseNumPagesFromLink ¶
Types ¶
type FieldDetails ¶
type FieldNode ¶
type FieldNode struct {
Details FieldDetails `graphql:"... on ProjectV2SingleSelectField"`
}
type GQLReviewThread ¶
type GithubClient ¶
type GithubClient struct {
// contains filtered or unexported fields
}
func NewGithubClient ¶
func NewGithubClient(clientREST *github.Client, clientGQL *githubv4.Client) *GithubClient
func NewGithubClientFromToken ¶
func NewGithubClientFromToken(ctx context.Context, token string) *GithubClient
func (*GithubClient) AddAssignees ¶
func (*GithubClient) CreateComment ¶
func (c *GithubClient) CreateComment(ctx context.Context, owner string, repo string, number int, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)
func (*GithubClient) CreateLabel ¶
func (*GithubClient) DeleteComment ¶
func (*GithubClient) DownloadContents ¶
func (c *GithubClient) DownloadContents(ctx context.Context, filePath string, branch *github.PullRequestBranch) ([]byte, error)
func (*GithubClient) EditComment ¶
func (c *GithubClient) EditComment(ctx context.Context, owner string, repo string, commentId int64, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)
func (*GithubClient) EditPullRequest ¶
func (c *GithubClient) EditPullRequest(ctx context.Context, owner string, repo string, number int, pull *github.PullRequest) (*github.PullRequest, *github.Response, error)
func (*GithubClient) GetClientGraphQL ¶
func (c *GithubClient) GetClientGraphQL() *githubv4.Client
func (*GithubClient) GetClientREST ¶
func (c *GithubClient) GetClientREST() *github.Client
FIXME: Remove these to hide the implementation details.
func (*GithubClient) GetComments ¶ added in v3.3.0
func (c *GithubClient) GetComments(ctx context.Context, owner string, repo string, number int, opts *github.IssueListCommentsOptions) ([]*github.IssueComment, error)
func (*GithubClient) GetDefaultRepositoryBranch ¶ added in v3.3.0
func (*GithubClient) GetIssueTimeline ¶ added in v3.3.0
func (*GithubClient) GetIssuesAvailableAssignees ¶
func (*GithubClient) GetProjectFieldsByProjectNumber ¶
func (*GithubClient) GetProjectV2ByName ¶
func (*GithubClient) GetPullRequest ¶
func (*GithubClient) GetPullRequestClosingIssuesCount ¶ added in v3.3.0
func (*GithubClient) GetPullRequestCommits ¶
func (c *GithubClient) GetPullRequestCommits(ctx context.Context, owner string, repo string, number int) ([]*github.RepositoryCommit, error)
func (*GithubClient) GetPullRequestFiles ¶
func (c *GithubClient) GetPullRequestFiles(ctx context.Context, owner string, repo string, number int) ([]*github.CommitFile, error)
func (*GithubClient) GetPullRequestReviewers ¶
func (*GithubClient) GetPullRequestReviews ¶
func (c *GithubClient) GetPullRequestReviews(ctx context.Context, owner string, repo string, number int) ([]*github.PullRequestReview, error)
func (*GithubClient) GetPullRequests ¶
func (c *GithubClient) GetPullRequests(ctx context.Context, owner string, repo string) ([]*github.PullRequest, error)
func (*GithubClient) GetRepoCollaborators ¶
func (*GithubClient) GetRepositoryBranch ¶
func (*GithubClient) GetReviewThreads ¶
func (c *GithubClient) GetReviewThreads(ctx context.Context, owner string, repo string, number int, retryCount int) ([]GQLReviewThread, error)
func (*GithubClient) ListCheckRunsForRef ¶
func (c *GithubClient) ListCheckRunsForRef(ctx context.Context, owner string, repo string, ref string, opts *github.ListCheckRunsOptions) (*github.ListCheckRunsResults, *github.Response, error)
func (*GithubClient) ListIssuesByRepo ¶
func (*GithubClient) ListOrganizationMembers ¶
func (*GithubClient) ListTeamMembersBySlug ¶
func (*GithubClient) Merge ¶
func (c *GithubClient) Merge(ctx context.Context, owner string, repo string, number int, commitMessage string, options *github.PullRequestOptions) (*github.PullRequestMergeResult, *github.Response, error)
func (*GithubClient) RemoveLabelForIssue ¶
func (*GithubClient) RequestReviewers ¶
func (c *GithubClient) RequestReviewers(ctx context.Context, owner string, repo string, number int, reviewers github.ReviewersRequest) (*github.PullRequest, *github.Response, error)
type ReviewThreadsQuery ¶
type ReviewThreadsQuery struct {
Repository struct {
PullRequest struct {
ReviewThreads struct {
Nodes []GQLReviewThread
PageInfo struct {
EndCursor githubv4.String
HasNextPage bool
}
} `graphql:"reviewThreads(first: 10, after: $reviewThreadsCursor)"`
} `graphql:"pullRequest(number: $pullRequestNumber)"`
} `graphql:"repository(owner: $repositoryOwner, name: $repositoryName)"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.