Documentation
¶
Overview ¶
Package github 封装 release-note 流程使用的 GitHub REST 读写边界。
Index ¶
- func ValidRepository(repository string) bool
- type Client
- func (client Client) FirstMergedPullRequest(ctx context.Context, repository, login string) (model.GitHubPullRequest, error)
- func (client Client) GetJSON(ctx context.Context, path string, destination any) error
- func (client Client) MergedPullRequestsByAuthor(ctx context.Context, repository, login string) ([]model.GitHubPullRequest, error)
- func (client Client) PullRequest(ctx context.Context, repository string, number int) (model.GitHubPullRequest, error)
- func (client Client) PullRequestsForCommit(ctx context.Context, repository, commit string) ([]model.GitHubPullRequest, error)
- func (client Client) RequestJSON(ctx context.Context, method, path string, input, destination any) error
- type HTTPError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidRepository ¶
ValidRepository 判断 owner/name 形式的 GitHub 仓库标识。
Types ¶
type Client ¶
Client 是 release-note 流程使用的 GitHub HTTP 客户端。 Token 只用于请求头,不会被错误信息或报告序列化。
func (Client) FirstMergedPullRequest ¶
func (client Client) FirstMergedPullRequest(ctx context.Context, repository, login string) (model.GitHubPullRequest, error)
FirstMergedPullRequest 找出某作者最早合并的 PR。 Search API 不支持按 merged_at 排序,因此逐页取得完整候选详情后再比较时间。
func (Client) MergedPullRequestsByAuthor ¶
func (client Client) MergedPullRequestsByAuthor(ctx context.Context, repository, login string) ([]model.GitHubPullRequest, error)
MergedPullRequestsByAuthor 读取某作者的全部已合并 PR。
func (Client) PullRequest ¶
func (client Client) PullRequest(ctx context.Context, repository string, number int) (model.GitHubPullRequest, error)
PullRequest 读取指定 PR 的完整信息。
func (Client) PullRequestsForCommit ¶
func (client Client) PullRequestsForCommit(ctx context.Context, repository, commit string) ([]model.GitHubPullRequest, error)
PullRequestsForCommit 查询一个 commit 关联的 PR。
Click to show internal directories.
Click to hide internal directories.