Documentation
¶
Index ¶
- func BuildURI(owner, repoName string) string
- type GithubClient
- func (g *GithubClient) BranchStatus(ctx context.Context, owner, repo string, sourceBranch, targetBranch string) (*scm.GitBranchStats, error)
- func (g *GithubClient) Comment(ctx context.Context, owner, repo string, number int, body string) error
- func (g *GithubClient) CommentUpdate(ctx context.Context, owner, repo string, number int, key, body string) error
- func (g *GithubClient) FetchRepositoryMetadata(ctx context.Context, identifier string) (*model.RepositoryMetadata, error)
- func (g *GithubClient) GetPullRequest(ctx context.Context, owner, repo string, number int) (*scm.PullRequest, error)
- func (g *GithubClient) MergePR(ctx context.Context, owner, repo string, number int, headSHA string) error
- func (g *GithubClient) ParseWebhook(r *http.Request) (*scm.WebhookEvent, error)
- func (g *GithubClient) SetStatus(ctx context.Context, owner, repo, sha string, state string, description string, ...) error
- type URIComponents
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GithubClient ¶
type GithubClient struct {
// contains filtered or unexported fields
}
func (*GithubClient) BranchStatus ¶
func (g *GithubClient) BranchStatus(ctx context.Context, owner, repo string, sourceBranch, targetBranch string) (*scm.GitBranchStats, error)
func (*GithubClient) Comment ¶
func (g *GithubClient) Comment(ctx context.Context, owner, repo string, number int, body string) error
Comment creates a new PR comment. Always posts a new comment, no deduplication.
func (*GithubClient) CommentUpdate ¶
func (g *GithubClient) CommentUpdate(ctx context.Context, owner, repo string, number int, key, body string) error
CommentUpdate upserts a PR comment identified by key. If a previous comment with the same key exists it is updated; otherwise a new one is created.
func (*GithubClient) FetchRepositoryMetadata ¶
func (g *GithubClient) FetchRepositoryMetadata(ctx context.Context, identifier string) (*model.RepositoryMetadata, error)
FetchRepositoryMetadata busca metadados completos do repositório do GitHub Aceita URI (https://github.com/owner/repo) ou ID numérico
func (*GithubClient) GetPullRequest ¶
func (g *GithubClient) GetPullRequest(ctx context.Context, owner, repo string, number int) (*scm.PullRequest, error)
func (*GithubClient) ParseWebhook ¶
func (g *GithubClient) ParseWebhook(r *http.Request) (*scm.WebhookEvent, error)
ParseWebhook valida a assinatura HMAC e converte para o modelo de domínio
type URIComponents ¶
type URIComponents struct {
Owner string // Nome do owner (user ou organization)
RepoName string // Nome do repositório
}
URIComponents contém os componentes extraídos de uma URI do GitHub
func ParseURI ¶
func ParseURI(uri string) (*URIComponents, error)
ParseURI extrai os componentes de uma URI do GitHub Formatos suportados: - https://github.com/owner/repo - https://github.com/owner/repo.git - git@github.com:owner/repo.git