github

package
v0.0.0-...-e5269e3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 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) GetInstallationClient

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

GetInstallationClient returns a client authenticated for a specific installation.

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) 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.

type Comment

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

Comment holds the comment from the IssueComment.

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"`
}

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.

Jump to

Keyboard shortcuts

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