Documentation
¶
Overview ¶
Package cloud is the Bitbucket Cloud adapter for the backend.Client interface.
Index ¶
- type Client
- func (c *Client) ApprovePR(ns, slug string, id int) error
- func (c *Client) CreateBranch(ns, slug string, in backend.CreateBranchInput) (backend.Branch, error)
- func (c *Client) CreatePR(ns, slug string, in backend.CreatePRInput) (backend.PullRequest, error)
- func (c *Client) CreateRepo(ns string, in backend.CreateRepoInput) (backend.Repository, error)
- func (c *Client) CreateTag(ns, slug string, in backend.CreateTagInput) (backend.Tag, error)
- func (c *Client) DeclinePR(ns, slug string, id int) error
- func (c *Client) DeleteBranch(ns, slug, branch string) error
- func (c *Client) DeleteRepo(ns, slug string) error
- func (c *Client) DeleteTag(ns, slug, name string) error
- func (c *Client) GetCommit(ns, slug, hash string) (backend.Commit, error)
- func (c *Client) GetCurrentUser() (backend.User, error)
- func (c *Client) GetPR(ns, slug string, id int) (backend.PullRequest, error)
- func (c *Client) GetPRDiff(ns, slug string, id int) (string, error)
- func (c *Client) GetPipeline(ns, slug, uuid string) (backend.Pipeline, error)
- func (c *Client) GetRepo(ns, slug string) (backend.Repository, error)
- func (c *Client) ListBranches(ns, slug string, limit int) ([]backend.Branch, error)
- func (c *Client) ListCommits(ns, slug, branch string, limit int) ([]backend.Commit, error)
- func (c *Client) ListPRs(ns, slug, state string, limit int) ([]backend.PullRequest, error)
- func (c *Client) ListPipelines(ns, slug string, limit int) ([]backend.Pipeline, error)
- func (c *Client) ListRepos(limit int) ([]backend.Repository, error)
- func (c *Client) ListTags(ns, slug string, limit int) ([]backend.Tag, error)
- func (c *Client) MergePR(ns, slug string, id int, in backend.MergePRInput) (backend.PullRequest, error)
- func (c *Client) ReadyPR(ns, slug string, id int) error
- func (c *Client) RequestChangesPR(ns, slug string, id int) error
- func (c *Client) RequestReview(ns, slug string, id int, users []string) error
- func (c *Client) RunPipeline(ns, slug string, in backend.RunPipelineInput) (backend.Pipeline, error)
- func (c *Client) UnapprovePR(ns, slug string, id int) error
- func (c *Client) UpdatePR(ns, slug string, id int, in backend.UpdatePRInput) (backend.PullRequest, error)
- type HTTPClient
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
}
Client is the Bitbucket Cloud HTTP client.
func NewClient ¶
func NewClient(httpClient HTTPClient, baseURL, token, username string) *Client
NewClient constructs a Cloud Client. If token is non-empty Bearer auth is used; else if username is non-empty Basic auth is used with username:token as credentials.
func (*Client) CreateBranch ¶
func (c *Client) CreateBranch(ns, slug string, in backend.CreateBranchInput) (backend.Branch, error)
CreateBranch creates a new branch in the given repository. Cloud requires a commit hash as the target; if StartAt is a branch name (not a 40-char hex string) it is resolved to its HEAD commit hash first.
func (*Client) CreatePR ¶
func (c *Client) CreatePR(ns, slug string, in backend.CreatePRInput) (backend.PullRequest, error)
CreatePR creates a new pull request.
func (*Client) CreateRepo ¶
func (c *Client) CreateRepo(ns string, in backend.CreateRepoInput) (backend.Repository, error)
CreateRepo creates a new repository in the workspace ns.
func (*Client) DeleteBranch ¶
DeleteBranch deletes a branch in a repository.
func (*Client) DeleteRepo ¶
DeleteRepo deletes a repository.
func (*Client) GetCurrentUser ¶
GetCurrentUser fetches the authenticated user.
func (*Client) GetPipeline ¶
GetPipeline fetches a single pipeline run by UUID.
func (*Client) GetRepo ¶
func (c *Client) GetRepo(ns, slug string) (backend.Repository, error)
GetRepo fetches a single repository.
func (*Client) ListBranches ¶
ListBranches lists branches for a repository.
func (*Client) ListCommits ¶
ListCommits lists commits on a branch for a repository.
func (*Client) ListPipelines ¶
ListPipelines lists recent pipeline runs for a repository.
func (*Client) ListRepos ¶
func (c *Client) ListRepos(limit int) ([]backend.Repository, error)
ListRepos lists repositories visible to the authenticated user. Bitbucket Cloud's /repositories endpoint is not workspace-scoped here; callers that need workspace-scoped listing should use GetRepo with ns.
func (*Client) MergePR ¶
func (c *Client) MergePR(ns, slug string, id int, in backend.MergePRInput) (backend.PullRequest, error)
MergePR merges a pull request.
func (*Client) RequestChangesPR ¶
RequestChangesPR requests changes on a pull request (Cloud only).
func (*Client) RequestReview ¶
RequestReview adds reviewers to a pull request (one request per user).
func (*Client) RunPipeline ¶
func (c *Client) RunPipeline(ns, slug string, in backend.RunPipelineInput) (backend.Pipeline, error)
RunPipeline triggers a new pipeline run on a branch.
func (*Client) UnapprovePR ¶
UnapprovePR removes the authenticated user's approval from a pull request.
func (*Client) UpdatePR ¶
func (c *Client) UpdatePR(ns, slug string, id int, in backend.UpdatePRInput) (backend.PullRequest, error)
UpdatePR updates the title and/or description of a pull request.
type HTTPClient ¶
HTTPClient is the transport interface for making HTTP requests.