Documentation
¶
Index ¶
- type BitbucketService
- func (b *BitbucketService) GetRepository(ctx context.Context, owner, repo string, settings krci.GitServerSettings) (*models.Repository, error)
- func (b *BitbucketService) ListBranches(ctx context.Context, owner, repo string, settings krci.GitServerSettings, ...) ([]models.Branch, error)
- func (b *BitbucketService) ListPipelines(ctx context.Context, project string, settings krci.GitServerSettings, ...) (*models.PipelinesResponse, error)
- func (b *BitbucketService) ListPullRequests(ctx context.Context, owner, repo string, settings krci.GitServerSettings, ...) (*models.PullRequestsResponse, error)
- func (b *BitbucketService) ListRepositories(ctx context.Context, account string, settings krci.GitServerSettings, ...) ([]models.Repository, error)
- func (b *BitbucketService) ListUserOrganizations(ctx context.Context, settings krci.GitServerSettings) ([]models.Organization, error)
- func (b *BitbucketService) TriggerPipeline(_ context.Context, _ string, _ string, _ []models.PipelineVariable, ...) (*models.PipelineResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitbucketService ¶
type BitbucketService struct {
// contains filtered or unexported fields
}
func NewBitbucketProvider ¶
func NewBitbucketProvider() *BitbucketService
func (*BitbucketService) GetRepository ¶
func (b *BitbucketService) GetRepository( ctx context.Context, owner, repo string, settings krci.GitServerSettings, ) (*models.Repository, error)
func (*BitbucketService) ListBranches ¶
func (b *BitbucketService) ListBranches( ctx context.Context, owner, repo string, settings krci.GitServerSettings, _ models.ListOptions, ) ([]models.Branch, error)
ListBranches implements BranchesProvider for BitbucketService.
func (*BitbucketService) ListPipelines ¶ added in v0.3.0
func (b *BitbucketService) ListPipelines( ctx context.Context, project string, settings krci.GitServerSettings, opts models.PipelineListOptions, ) (*models.PipelinesResponse, error)
ListPipelines returns pipelines for a Bitbucket repository using the REST API.
func (*BitbucketService) ListPullRequests ¶ added in v0.2.0
func (b *BitbucketService) ListPullRequests( ctx context.Context, owner, repo string, settings krci.GitServerSettings, opts models.PullRequestListOptions, ) (*models.PullRequestsResponse, error)
ListPullRequests returns pull requests for the given repository using the Bitbucket REST API. Direct HTTP (via go-resty) is used instead of go-bitbucket's PullRequests.Gets() because the library auto-paginates all pages into memory and lacks page/perPage control.
func (*BitbucketService) ListRepositories ¶
func (b *BitbucketService) ListRepositories( ctx context.Context, account string, settings krci.GitServerSettings, listOptions models.ListOptions, ) ([]models.Repository, error)
func (*BitbucketService) ListUserOrganizations ¶
func (b *BitbucketService) ListUserOrganizations( ctx context.Context, settings krci.GitServerSettings, ) ([]models.Organization, error)
ListUserOrganizations returns workspaces for the authenticated user using a direct HTTP call to the Bitbucket REST API.
Why direct HTTP instead of go-bitbucket client.Workspaces.List():
- The go-bitbucket library (v0.9.95) calls the deprecated /2.0/workspaces endpoint, which Bitbucket removed as announced in: https://developer.atlassian.com/cloud/bitbucket/changelog/#CHANGE-2770 https://developer.atlassian.com/cloud/bitbucket/changelog/#CHANGE-3022
- The correct endpoint is now /2.0/user/workspaces (requires authentication): https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-user-workspaces-get
- The library has not been updated to support the new endpoint, so we call it directly using the same go-resty HTTP client used by ListPullRequests and ListPipelines.
func (*BitbucketService) TriggerPipeline ¶ added in v0.3.0
func (b *BitbucketService) TriggerPipeline( _ context.Context, _ string, _ string, _ []models.PipelineVariable, _ krci.GitServerSettings, ) (*models.PipelineResponse, error)
TriggerPipeline is not supported for Bitbucket.