Documentation
¶
Index ¶
- func NewInstallationGitHubClient(appID int, privateKey []byte, repoOwner RepositoryOwner) (*ghapi.Client, error)
- func TrimCommentSentimentAnalysis(comment string) (string, error)
- func UpdateCommentWithSentiment(comment string, analysis sa.Analysis) (string, error)
- type Comment
- type CommentPayload
- type CommentType
- type CommentUser
- type Issue
- type PullRequest
- type Repository
- type RepositoryOwner
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInstallationGitHubClient ¶
func NewInstallationGitHubClient(appID int, privateKey []byte, repoOwner RepositoryOwner) (*ghapi.Client, error)
NewInstallationGitHubClient creates a new client for the installation.
func TrimCommentSentimentAnalysis ¶
TrimCommentSentimentAnalysis removes any sentiment analysis from a comment.
Types ¶
type Comment ¶
type Comment struct { Body string `json:"body"` ID int64 `json:"id"` PullRequestReviewID *int64 `json:"pull_request_review_id,omitempty"` CommentUser CommentUser `json:"user"` }
Comment is the comment on a GitHub issue from the payload.
type CommentPayload ¶
type CommentPayload struct { Action string `json:"action"` Comment Comment `json:"comment"` Issue *Issue `json:"issue,omitempty"` PullRequest *PullRequest `json:"pull_request,omitempty"` Repository Repository `json:"repository"` Sender Sender `json:"sender"` }
CommentPayload represents the payload from GitHub for an issue comment. For more info or to see other fields that might be available, take a look at the webhook events and payloads for:
issue_comment: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issue_comment pull_request_review_comment: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request_review_comment
func (CommentPayload) CommentType ¶
func (c CommentPayload) CommentType() (CommentType, error)
CommentType returns the type of comment that it is.
func (CommentPayload) UpdateComment ¶
func (c CommentPayload) UpdateComment(client *ghapi.Client, newComment string) error
UpdateComment updates the comment payload text.
type CommentType ¶
type CommentType int
CommentType allows the ability to distinguish different comment types.
const ( // CommentTypeIssueComment represents a GitHub issue comment. CommentTypeIssueComment CommentType = iota // CommentTypePullRequestReviewComment represents a GitHub pull request // review comment. CommentTypePullRequestReviewComment // CommentTypeUnknown is the indication that the comment type is unknown // and the output should likely not be trusted. CommentTypeUnknown )
type CommentUser ¶
type CommentUser struct {
Login string `json:"login"`
}
CommentUser represents the user of the comment.
type PullRequest ¶
type PullRequest struct {
URL string `json:"url"`
}
PullRequest represents a GitHub pull request.
type Repository ¶
type Repository struct { FullName string `json:"full_name"` Name string `json:"name"` Owner RepositoryOwner `json:"owner"` }
Repository represents a GitHub repo.
type RepositoryOwner ¶
type RepositoryOwner struct {
Login string `json:"login"`
}
RepositoryOwner represents the repo owner.