github

package
v1.0.0-beta.10 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const BotCommentMarker = "<!-- manque-ai-bot -->"

BotCommentMarker is used to identify comments created by this bot

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token, apiURL string) *Client

func (*Client) CreateComment

func (c *Client) CreateComment(owner, repo string, number int, body string) error

func (*Client) CreateOrUpdateComment

func (c *Client) CreateOrUpdateComment(owner, repo string, number int, body string) error

CreateOrUpdateComment creates a new comment or updates an existing bot comment

func (*Client) CreateReview

func (c *Client) CreateReview(owner, repo string, number int, comments []*github.DraftReviewComment, body *string, action string) error

func (*Client) CreateReviewWithOptions

func (c *Client) CreateReviewWithOptions(owner, repo string, number int, comments []*github.DraftReviewComment, body *string, action string, opts CreateReviewOptions) error

func (*Client) FindBotComment

func (c *Client) FindBotComment(owner, repo string, number int) (*github.IssueComment, error)

FindBotComment finds an existing comment created by this bot

func (*Client) GetCommentThread

func (c *Client) GetCommentThread(owner, repo string, number int, commentID int64) ([]ConversationMessage, error)

GetCommentThread gets the conversation thread for a review comment

func (*Client) GetExistingCommentsByLocation

func (c *Client) GetExistingCommentsByLocation(owner, repo string, number int) (map[string]*ExistingComment, error)

GetExistingCommentsByLocation returns existing comments indexed by file:line

func (*Client) GetIssueCommentThread

func (c *Client) GetIssueCommentThread(owner, repo string, number int) ([]ConversationMessage, error)

GetIssueCommentThread gets conversation thread from issue comments

func (*Client) GetPR

func (c *Client) GetPR(owner, repo string, number int) (*PRInfo, error)

func (*Client) GetPRFromEvent

func (c *Client) GetPRFromEvent(eventPath string) (*PRInfo, error)

func (*Client) GetPRFromURL

func (c *Client) GetPRFromURL(url string) (*PRInfo, error)

func (*Client) ListReviewComments

func (c *Client) ListReviewComments(owner, repo string, number int) ([]*github.PullRequestComment, error)

ListReviewComments lists all review comments on a pull request

func (*Client) ReplyToComment

func (c *Client) ReplyToComment(owner, repo string, number int, commentID int64, body string) error

ReplyToComment adds a reply to an existing review comment

func (*Client) UpdateComment

func (c *Client) UpdateComment(owner, repo string, commentID int64, body string) error

UpdateComment updates an existing review comment

func (*Client) UpdatePR

func (c *Client) UpdatePR(owner, repo string, number int, title, body *string) error

type ConversationMessage

type ConversationMessage struct {
	Author    string
	Body      string
	IsBot     bool
	CreatedAt string
	ID        int64
}

ConversationMessage represents a single message in a conversation thread

type CreateReviewOptions

type CreateReviewOptions struct {
	IsIncremental bool // If true, reply to existing comments instead of creating new ones
}

CreateReviewOptions configures the review creation behavior

type ExistingComment

type ExistingComment struct {
	ID        int64
	Path      string
	StartLine int
	EndLine   int
	Body      string
	IsBot     bool // True if created by manque-ai
}

ExistingComment represents a comment that already exists on a PR

type GitHubEvent

type GitHubEvent struct {
	PullRequest struct {
		Number int    `json:"number"`
		Title  string `json:"title"`
		Body   string `json:"body"`
		Head   struct {
			SHA string `json:"sha"`
		} `json:"head"`
	} `json:"pull_request"`
	Repository struct {
		FullName string `json:"full_name"`
		Name     string `json:"name"`
		Owner    struct {
			Login string `json:"login"`
		} `json:"owner"`
	} `json:"repository"`
}

type PRInfo

type PRInfo struct {
	Number      int
	Title       string
	Description string
	Repository  string
	Owner       string
	Diff        string
	HeadSHA     string
}

Jump to

Keyboard shortcuts

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