Documentation
¶
Index ¶
- type GitHubClient
- func (ghc *GitHubClient) AddLabelsToPR(ctx context.Context, prNumber int, labels []string) error
- func (ghc *GitHubClient) CreateLabel(ctx context.Context, name, color, description string) error
- func (ghc *GitHubClient) CreateRelease(ctx context.Context, release *models.Release, notes *models.ReleaseNotes, ...) error
- func (ghc *GitHubClient) GetClosedIssuesBetweenTags(ctx context.Context, previousTag, _ string) ([]models.Issue, error)
- func (ghc *GitHubClient) GetContributorsBetweenTags(ctx context.Context, previousTag, currentTag string) ([]string, error)
- func (ghc *GitHubClient) GetFileAtTag(ctx context.Context, tag, filepath string) (string, error)
- func (ghc *GitHubClient) GetFileStatsBetweenTags(ctx context.Context, previousTag, currentTag string) (*models.FileStatistics, error)
- func (ghc *GitHubClient) GetIssue(ctx context.Context, issueNumber int) (*models.Issue, error)
- func (ghc *GitHubClient) GetMergedPRsBetweenTags(ctx context.Context, previousTag, _ string) ([]models.PullRequest, error)
- func (ghc *GitHubClient) GetPR(ctx context.Context, prNumber int) (models.PRData, error)
- func (ghc *GitHubClient) GetPRIssues(ctx context.Context, branchName string, commits []string, prDescription string) ([]models.Issue, error)
- func (ghc *GitHubClient) GetRelease(ctx context.Context, version string) (*models.VCSRelease, error)
- func (ghc *GitHubClient) GetRepoLabels(ctx context.Context) ([]string, error)
- func (ghc *GitHubClient) UpdateIssueChecklist(ctx context.Context, issueNumber int, checkedIndices []int) error
- func (ghc *GitHubClient) UpdatePR(ctx context.Context, prNumber int, summary models.PRSummary) error
- func (ghc *GitHubClient) UpdateRelease(ctx context.Context, version, body string) error
- type GitHubProviderFactory
- type IssuesService
- type MockIssuesService
- func (m *MockIssuesService) AddLabelsToIssue(ctx context.Context, owner, repo string, number int, labels []string) ([]*github.Label, *github.Response, error)
- func (m *MockIssuesService) CreateLabel(ctx context.Context, owner, repo string, label *github.Label) (*github.Label, *github.Response, error)
- func (m *MockIssuesService) Edit(ctx context.Context, owner, repo string, number int, ...) (*github.Issue, *github.Response, error)
- func (m *MockIssuesService) Get(ctx context.Context, owner, repo string, number int) (*github.Issue, *github.Response, error)
- func (m *MockIssuesService) ListByRepo(ctx context.Context, owner, repo string, opts *github.IssueListByRepoOptions) ([]*github.Issue, *github.Response, error)
- func (m *MockIssuesService) ListLabels(ctx context.Context, owner, repo string, opts *github.ListOptions) ([]*github.Label, *github.Response, error)
- type MockPRService
- func (m *MockPRService) Edit(ctx context.Context, owner, repo string, number int, pr *github.PullRequest) (*github.PullRequest, *github.Response, error)
- func (m *MockPRService) Get(ctx context.Context, owner, repo string, number int) (*github.PullRequest, *github.Response, error)
- func (m *MockPRService) GetRaw(ctx context.Context, owner, repo string, number int, opts github.RawOptions) (string, *github.Response, error)
- func (m *MockPRService) List(ctx context.Context, owner, repo string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)
- func (m *MockPRService) ListCommits(ctx context.Context, owner, repo string, number int, opts *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error)
- type MockReleaseService
- func (m *MockReleaseService) CreateRelease(ctx context.Context, owner, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)
- func (m *MockReleaseService) EditRelease(ctx context.Context, owner, repo string, id int64, ...) (*github.RepositoryRelease, *github.Response, error)
- func (m *MockReleaseService) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*github.RepositoryRelease, *github.Response, error)
- type MockRepoService
- func (m *MockRepoService) CompareCommits(ctx context.Context, owner, repo, base, head string, opts *github.ListOptions) (*github.CommitsComparison, *github.Response, error)
- func (m *MockRepoService) GetCommit(ctx context.Context, owner, repo, sha string, opts *github.ListOptions) (*github.RepositoryCommit, *github.Response, error)
- func (m *MockRepoService) GetContents(ctx context.Context, owner, repo, path string, ...) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, ...)
- type PullRequestsService
- type ReleasesService
- type RepositoriesService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHubClient ¶
type GitHubClient struct {
// contains filtered or unexported fields
}
func NewGitHubClient ¶
func NewGitHubClient(owner, repo, token string, trans *i18n.Translations) *GitHubClient
func NewGitHubClientWithServices ¶
func NewGitHubClientWithServices( prService PullRequestsService, issuesService IssuesService, repoService RepositoriesService, releaseService ReleasesService, owner string, repo string, trans *i18n.Translations, ) *GitHubClient
func (*GitHubClient) AddLabelsToPR ¶
func (*GitHubClient) CreateLabel ¶
func (ghc *GitHubClient) CreateLabel(ctx context.Context, name, color, description string) error
func (*GitHubClient) CreateRelease ¶ added in v1.3.0
func (ghc *GitHubClient) CreateRelease(ctx context.Context, release *models.Release, notes *models.ReleaseNotes, draft bool) error
func (*GitHubClient) GetClosedIssuesBetweenTags ¶ added in v1.4.0
func (*GitHubClient) GetContributorsBetweenTags ¶ added in v1.4.0
func (*GitHubClient) GetFileAtTag ¶ added in v1.4.0
func (*GitHubClient) GetFileStatsBetweenTags ¶ added in v1.4.0
func (ghc *GitHubClient) GetFileStatsBetweenTags(ctx context.Context, previousTag, currentTag string) (*models.FileStatistics, error)
func (*GitHubClient) GetMergedPRsBetweenTags ¶ added in v1.4.0
func (ghc *GitHubClient) GetMergedPRsBetweenTags(ctx context.Context, previousTag, _ string) ([]models.PullRequest, error)
func (*GitHubClient) GetPRIssues ¶ added in v1.4.0
func (*GitHubClient) GetRelease ¶ added in v1.4.0
func (ghc *GitHubClient) GetRelease(ctx context.Context, version string) (*models.VCSRelease, error)
func (*GitHubClient) GetRepoLabels ¶
func (ghc *GitHubClient) GetRepoLabels(ctx context.Context) ([]string, error)
func (*GitHubClient) UpdateIssueChecklist ¶ added in v1.4.0
func (*GitHubClient) UpdateRelease ¶ added in v1.4.0
func (ghc *GitHubClient) UpdateRelease(ctx context.Context, version, body string) error
type GitHubProviderFactory ¶ added in v1.4.0
type GitHubProviderFactory struct{}
GitHubProviderFactory implementa VCSProviderFactory para GitHub
func NewGitHubProviderFactory ¶ added in v1.4.0
func NewGitHubProviderFactory() *GitHubProviderFactory
NewGitHubProviderFactory crea una nueva factory para GitHub
func (*GitHubProviderFactory) CreateClient ¶ added in v1.4.0
func (f *GitHubProviderFactory) CreateClient( _ context.Context, owner, repo, token string, trans *i18n.Translations, ) (ports.VCSClient, error)
CreateClient crea un cliente GitHub
func (*GitHubProviderFactory) Name ¶ added in v1.4.0
func (f *GitHubProviderFactory) Name() string
Name retorna el nombre del proveedor
func (*GitHubProviderFactory) ValidateConfig ¶ added in v1.4.0
func (f *GitHubProviderFactory) ValidateConfig(cfg *config.VCSConfig) error
ValidateConfig valida la configuración de GitHub
type IssuesService ¶
type IssuesService interface {
ListLabels(ctx context.Context, owner, repo string, opts *github.ListOptions) ([]*github.Label, *github.Response, error)
CreateLabel(ctx context.Context, owner, repo string, label *github.Label) (*github.Label, *github.Response, error)
AddLabelsToIssue(ctx context.Context, owner, repo string, number int, labels []string) ([]*github.Label, *github.Response, error)
ListByRepo(ctx context.Context, owner, repo string, opts *github.IssueListByRepoOptions) ([]*github.Issue, *github.Response, error)
Get(ctx context.Context, owner, repo string, number int) (*github.Issue, *github.Response, error)
Edit(ctx context.Context, owner, repo string, number int, issue *github.IssueRequest) (*github.Issue, *github.Response, error)
}
type MockIssuesService ¶
func (*MockIssuesService) AddLabelsToIssue ¶
func (*MockIssuesService) CreateLabel ¶
func (*MockIssuesService) ListByRepo ¶ added in v1.4.0
func (*MockIssuesService) ListLabels ¶
type MockPRService ¶
func (*MockPRService) Edit ¶
func (m *MockPRService) Edit(ctx context.Context, owner, repo string, number int, pr *github.PullRequest) (*github.PullRequest, *github.Response, error)
func (*MockPRService) Get ¶
func (m *MockPRService) Get(ctx context.Context, owner, repo string, number int) (*github.PullRequest, *github.Response, error)
func (*MockPRService) List ¶ added in v1.4.0
func (m *MockPRService) List(ctx context.Context, owner, repo string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)
func (*MockPRService) ListCommits ¶
func (m *MockPRService) ListCommits(ctx context.Context, owner, repo string, number int, opts *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error)
type MockReleaseService ¶ added in v1.3.0
func (*MockReleaseService) CreateRelease ¶ added in v1.3.0
func (m *MockReleaseService) CreateRelease(ctx context.Context, owner, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)
func (*MockReleaseService) EditRelease ¶ added in v1.4.0
func (m *MockReleaseService) EditRelease(ctx context.Context, owner, repo string, id int64, release *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)
func (*MockReleaseService) GetReleaseByTag ¶ added in v1.4.0
func (m *MockReleaseService) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*github.RepositoryRelease, *github.Response, error)
type MockRepoService ¶ added in v1.3.0
func (*MockRepoService) CompareCommits ¶ added in v1.4.0
func (m *MockRepoService) CompareCommits(ctx context.Context, owner, repo, base, head string, opts *github.ListOptions) (*github.CommitsComparison, *github.Response, error)
func (*MockRepoService) GetCommit ¶ added in v1.3.0
func (m *MockRepoService) GetCommit(ctx context.Context, owner, repo, sha string, opts *github.ListOptions) (*github.RepositoryCommit, *github.Response, error)
func (*MockRepoService) GetContents ¶ added in v1.4.0
func (m *MockRepoService) GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error)
type PullRequestsService ¶
type PullRequestsService interface {
Edit(ctx context.Context, owner, repo string, number int, pr *github.PullRequest) (*github.PullRequest, *github.Response, error)
List(ctx context.Context, owner, repo string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)
Get(ctx context.Context, owner, repo string, number int) (*github.PullRequest, *github.Response, error)
ListCommits(ctx context.Context, owner, repo string, number int, opts *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error)
GetRaw(ctx context.Context, owner, repo string, number int, opts github.RawOptions) (string, *github.Response, error)
}
type ReleasesService ¶ added in v1.3.0
type ReleasesService interface {
CreateRelease(ctx context.Context, owner, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)
GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*github.RepositoryRelease, *github.Response, error)
EditRelease(ctx context.Context, owner, repo string, id int64, release *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)
}
type RepositoriesService ¶ added in v1.3.0
type RepositoriesService interface {
GetCommit(ctx context.Context, owner, repo, sha string, opts *github.ListOptions) (*github.RepositoryCommit, *github.Response, error)
CompareCommits(ctx context.Context, owner, repo, base, head string, opts *github.ListOptions) (*github.CommitsComparison, *github.Response, error)
GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error)
}
Click to show internal directories.
Click to hide internal directories.