github

package
v0.0.0-...-e487a75 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: Apache-2.0 Imports: 11 Imported by: 0 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

This section is empty.

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(cfg *config.Config) (*Client, error)

func (*Client) CommitAndPush

func (c *Client) CommitAndPush(workspace *models.Workspace, result *models.ExecutionResult, codeClient code.Code) (string, error)

CommitAndPush 检测文件变更并提交推送

func (*Client) CreateBranch

func (c *Client) CreateBranch(workspace *models.Workspace) error

CreateBranch creates branch locally and pushes to remote

func (*Client) CreateComment

func (c *Client) CreateComment(ctx context.Context, owner, repo string, issueNumber int, body string) (*github.IssueComment, error)

CreateComment 在Issue或PR上创建评论

func (*Client) CreatePullRequest

func (c *Client) CreatePullRequest(workspace *models.Workspace) (*github.PullRequest, error)

CreatePullRequest 创建 Pull Request

func (*Client) CreatePullRequestComment

func (c *Client) CreatePullRequestComment(pr *github.PullRequest, commentBody string) error

CreatePullRequestComment 在 PR 上创建评论

func (*Client) DeleteCodeAgentBranch

func (c *Client) DeleteCodeAgentBranch(ctx context.Context, owner, repo, branchName string) error

DeleteCodeAgentBranch 删除CodeAgent创建的分支

func (*Client) GetAllPRComments

func (c *Client) GetAllPRComments(pr *github.PullRequest) (*models.PRAllComments, error)

GetAllPRComments 获取 PR 的所有评论,包括一般评论和代码行评论

func (*Client) GetClient

func (c *Client) GetClient() *github.Client

GetClient 获取底层的GitHub客户端(用于MCP服务器)

func (*Client) GetComment

func (c *Client) GetComment(ctx context.Context, owner, repo string, commentID int64) (*github.IssueComment, error)

GetComment 获取评论内容

func (*Client) GetPullRequest

func (c *Client) GetPullRequest(owner, repo string, prNumber int) (*github.PullRequest, error)

GetPullRequest 获取 PR 的完整信息

func (*Client) GetReviewComments

func (c *Client) GetReviewComments(pr *github.PullRequest, reviewID int64) ([]*github.PullRequestComment, error)

GetReviewComments 获取指定 review 的所有 comments

func (*Client) PullLatestChanges

func (c *Client) PullLatestChanges(workspace *models.Workspace, pr *github.PullRequest) error

PullLatestChanges 拉取远端最新代码(优先使用rebase策略)

func (*Client) ReplyToReviewComment

func (c *Client) ReplyToReviewComment(pr *github.PullRequest, commentID int64, commentBody string) error

ReplyToReviewComment 回复 PR 代码行评论

func (*Client) UpdateComment

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

UpdateComment 更新已存在的评论

func (*Client) UpdatePullRequest

func (c *Client) UpdatePullRequest(pr *github.PullRequest, newBody string) error

UpdatePullRequest 更新 PR 的 Body

Jump to

Keyboard shortcuts

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