github

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*github.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(appID int64, privateKeyPEM string) (*Client, error)

NewClient returns a new GitHub Client for App authentication.

func (*Client) EditComment

func (c *Client) EditComment(ctx context.Context, installationID int64, owner, repo string, commentID int64, body string) error

EditComment edits an existing issue comment by ID.

func (*Client) FetchComment

func (c *Client) FetchComment(ctx context.Context, installationID int64, owner, repo string, commentID uint64) (*IssueComment, error)

FetchComment fetches a comment by ID from the GitHub API using the given installation, owner, and repo, then fetches the parent issue to construct a full IssueComment.

func (*Client) GetInstallationClient

func (c *Client) GetInstallationClient(ctx context.Context, installationID int64) (*github.Client, error)

GetInstallationClient returns a client authenticated for a specific installation.

func (*Client) ListIssueComments

func (c *Client) ListIssueComments(ctx context.Context, installationID int64, owner, repo string, issueNumber int) ([]*github.IssueComment, error)

ListIssueComments lists all comments on an issue.

func (*Client) PostComment

func (c *Client) PostComment(ctx context.Context, installationID int64, issueComment *IssueComment, body string) error

PostComment sends a comment to an issue.

func (*Client) ReactWithConfused

func (c *Client) ReactWithConfused(ctx context.Context, installationID int64, issueComment *IssueComment) error

ReactWithThumbsUp sends a :confused: reaction to the given IssueComment.

func (*Client) ReactWithThumbsUp

func (c *Client) ReactWithThumbsUp(ctx context.Context, installationID int64, issueComment *IssueComment) error

ReactWithThumbsUp sends a :+1: reaction to the given IssueComment.

func (*Client) UpdateIssueDescription

func (c *Client) UpdateIssueDescription(ctx context.Context, installationID int64, issueComment *IssueComment, body string) error

UpdateIssueDescription updates the issue description.

func (*Client) UpdateIssueTitle added in v1.1.0

func (c *Client) UpdateIssueTitle(ctx context.Context, installationID int64, issueComment *IssueComment, title string) error

UpdateIssueTitle updates the issue title.

type Comment

type Comment struct {
	Body      string      `json:"body"`
	NodeID    string      `json:"node_id"`
	ID        uint64      `json:"id"`
	Reactions Reactions   `json:"reactions"`
	User      CommentUser `json:"user"`
}

Comment holds the comment from the IssueComment.

type CommentUser

type CommentUser struct {
	Login string `json:"login"`
}

CommentUser holds the user who authored a comment.

type Installation

type Installation struct {
	ID int64 `json:"id"`
}

Installation holds the GitHub App installation info.

type Issue

type Issue struct {
	CommentsURL string `json:"comments_url"`
	Body        string `json:"body"`
	State       string `json:"state"`
	URL         string `json:"url"`
	HTMLURL     string `json:"html_url"`
	Title       string `json:"title"`
}

Issue holds the issue from the issue comment.

type IssueComment

type IssueComment struct {
	Action       string `json:"action"`
	Issue        `json:"issue"`
	Comment      `json:"comment"`
	Installation Installation `json:"installation"`
	Repository   Repository   `json:"repository"`
}

IssueComment holds the comment received.

func (IssueComment) ToJSON

func (ic IssueComment) ToJSON() ([]byte, error)

Converts the IssueComment into a JSON.

type Reactions

type Reactions struct {
	URL string `json:"url"`
}

Reactions from the Comment.

type Repository

type Repository struct {
	Owner    RepositoryOwner `json:"owner"`
	Name     string          `json:"name"`
	FullName string          `json:"full_name"`
}

Repository holds the repository info from the webhook payload.

type RepositoryOwner

type RepositoryOwner struct {
	Login string `json:"login"`
}

RepositoryOwner holds the owner info of a repository.

Jump to

Keyboard shortcuts

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