{"modulePath":"github.com/trstringer/comment-sentiment","version":"v0.0.0-20220526123000-8a4ab9df428c","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\n## Functions\n\n```go\nfunc NewInstallationGitHubClient(appID int, privateKey []byte, repoOwner RepositoryOwner) (*ghapi.Client, error)\n```\nNewInstallationGitHubClient creates a new client for the installation.\n\n```go\nfunc TrimCommentSentimentAnalysis(comment string) (string, error)\n```\nTrimCommentSentimentAnalysis removes any sentiment analysis from a comment.\n\n```go\nfunc UpdateCommentWithSentiment(comment string, analysis sa.Analysis) (string, error)\n```\nUpdateCommentWithSentiment changes the comment text to include the analyzed sentiment.\n\n## Types\n\n```go\ntype Comment struct {\n\tBody                string      `json:\"body\"`\n\tID                  int64       `json:\"id\"`\n\tPullRequestReviewID *int64      `json:\"pull_request_review_id,omitempty\"`\n\tCommentUser         CommentUser `json:\"user\"`\n}\n```\nComment is the comment on a GitHub issue from the payload.\n\n```go\ntype CommentPayload struct {\n\tAction      string       `json:\"action\"`\n\tComment     Comment      `json:\"comment\"`\n\tIssue       *Issue       `json:\"issue,omitempty\"`\n\tPullRequest *PullRequest `json:\"pull_request,omitempty\"`\n\tRepository  Repository   `json:\"repository\"`\n\tSender      Sender       `json:\"sender\"`\n}\n```\nCommentPayload 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:\n\n\tissue_comment: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issue_comment\n\tpull_request_review_comment: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request_review_comment\n\n```go\nfunc (c CommentPayload) CommentType() (CommentType, error)\n```\nCommentType returns the type of comment that it is.\n\n```go\nfunc (c CommentPayload) UpdateComment(client *ghapi.Client, newComment string) error\n```\nUpdateComment updates the comment payload text.\n\n```go\ntype CommentType int\n```\nCommentType allows the ability to distinguish different comment types.\n\n```go\nconst (\n\t// CommentTypeIssueComment represents a GitHub issue comment.\n\tCommentTypeIssueComment CommentType = iota\n\t// CommentTypePullRequestReviewComment represents a GitHub pull request\n\t// review comment.\n\tCommentTypePullRequestReviewComment\n\t// CommentTypeUnknown is the indication that the comment type is unknown\n\t// and the output should likely not be trusted.\n\tCommentTypeUnknown\n)\n```\n\n```go\ntype CommentUser struct {\n\tLogin string `json:\"login\"`\n}\n```\nCommentUser represents the user of the comment.\n\n```go\ntype Issue struct {\n\tID  int64  `json:\"id\"`\n\tURL string `json:\"url\"`\n}\n```\nIssue represents a GitHub issue.\n\n```go\ntype PullRequest struct {\n\tURL string `json:\"url\"`\n}\n```\nPullRequest represents a GitHub pull request.\n\n```go\ntype Repository struct {\n\tFullName string          `json:\"full_name\"`\n\tName     string          `json:\"name\"`\n\tOwner    RepositoryOwner `json:\"owner\"`\n}\n```\nRepository represents a GitHub repo.\n\n```go\ntype RepositoryOwner struct {\n\tLogin string `json:\"login\"`\n}\n```\nRepositoryOwner represents the repo owner.\n\n```go\ntype Sender struct {\n\tLogin string `json:\"login\"`\n}\n```\nSender represents the sender of the action from the GitHub API.\n\n","path":"github.com/trstringer/comment-sentiment/pkg/github","name":"github","synopsis":"","isRedistributable":true}
