Documentation ¶
Overview ¶
Package bitbucketcloud holds code for Bitbucket Cloud aka (bitbucket.org). It is separate from bitbucketserver because Bitbucket Server has different APIs.
Index ¶
- Constants
- type Actor
- type Author
- type Branch
- type BranchMeta
- type Client
- func (b *Client) CreateComment(logger logging.SimpleLogging, repo models.Repo, pullNum int, comment string, ...) error
- func (b *Client) DiscardReviews(_ models.Repo, _ models.PullRequest) error
- func (b *Client) GetCloneURL(_ logging.SimpleLogging, _ models.VCSHostType, _ string) (string, error)
- func (b *Client) GetFileContent(_ logging.SimpleLogging, _ models.PullRequest, _ string) (bool, []byte, error)
- func (b *Client) GetModifiedFiles(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest) ([]string, error)
- func (b *Client) GetPullLabels(_ logging.SimpleLogging, _ models.Repo, _ models.PullRequest) ([]string, error)
- func (b *Client) GetTeamNamesForUser(_ models.Repo, _ models.User) ([]string, error)
- func (b *Client) HidePrevCommandComments(_ logging.SimpleLogging, _ models.Repo, _ int, _ string, _ string) error
- func (b *Client) MarkdownPullLink(pull models.PullRequest) (string, error)
- func (b *Client) MergePull(logger logging.SimpleLogging, pull models.PullRequest, ...) error
- func (b *Client) PullIsApproved(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest) (approvalStatus models.ApprovalStatus, err error)
- func (b *Client) PullIsMergeable(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, ...) (bool, error)
- func (b *Client) ReactToComment(_ logging.SimpleLogging, _ models.Repo, _ int, _ int64, _ string) error
- func (b *Client) SupportsSingleFileDownload(models.Repo) bool
- func (b *Client) UpdateStatus(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, ...) error
- type Comment
- type CommentContent
- type CommentEvent
- type Commit
- type CommonEventData
- type DiffStat
- type DiffStatFile
- type DiffStatValue
- type Link
- type Links
- type Participant
- type PullRequest
- type PullRequestEvent
- type Repository
Constants ¶
const ( PullCreatedHeader = "pullrequest:created" PullUpdatedHeader = "pullrequest:updated" PullFulfilledHeader = "pullrequest:fulfilled" PullRejectedHeader = "pullrequest:rejected" PullCommentCreatedHeader = "pullrequest:comment_created" )
const BaseURL = "https://api.bitbucket.org"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct {
AccountID *string `json:"account_id,omitempty" validate:"required"`
}
type Author ¶ added in v0.8.1
type Author struct {
UUID *string `json:"uuid,omitempty" validate:"required"`
}
type BranchMeta ¶ added in v0.4.14
type BranchMeta struct { Repository *Repository `json:"repository,omitempty" validate:"required"` Commit *Commit `json:"commit,omitempty" validate:"required"` Branch *Branch `json:"branch,omitempty" validate:"required"` }
type Client ¶
type Client struct { HTTPClient *http.Client Username string Password string BaseURL string AtlantisURL string }
func NewClient ¶
func NewClient(httpClient *http.Client, username string, password string, atlantisURL string) *Client
NewClient builds a bitbucket cloud client. atlantisURL is the URL for Atlantis that will be linked to from the build status icons. This linking is annoying because we don't have anywhere good to link but a URL is required.
func (*Client) CreateComment ¶
func (b *Client) CreateComment(logger logging.SimpleLogging, repo models.Repo, pullNum int, comment string, _ string) error
CreateComment creates a comment on the merge request.
func (*Client) DiscardReviews ¶ added in v0.22.0
func (*Client) GetCloneURL ¶ added in v0.19.8
func (b *Client) GetCloneURL(_ logging.SimpleLogging, _ models.VCSHostType, _ string) (string, error)
func (*Client) GetFileContent ¶ added in v0.22.0
func (b *Client) GetFileContent(_ logging.SimpleLogging, _ models.PullRequest, _ string) (bool, []byte, error)
GetFileContent a repository file content from VCS (which support fetch a single file from repository) The first return value indicates whether the repo contains a file or not if BaseRepo had a file, its content will placed on the second return value
func (*Client) GetModifiedFiles ¶
func (b *Client) GetModifiedFiles(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest) ([]string, error)
GetModifiedFiles returns the names of files that were modified in the merge request relative to the repo root, e.g. parent/child/file.txt.
func (*Client) GetPullLabels ¶ added in v0.26.0
func (b *Client) GetPullLabels(_ logging.SimpleLogging, _ models.Repo, _ models.PullRequest) ([]string, error)
func (*Client) GetTeamNamesForUser ¶ added in v0.18.0
GetTeamNamesForUser returns the names of the teams or groups that the user belongs to (in the organization the repository belongs to).
func (*Client) HidePrevCommandComments ¶ added in v0.17.1
func (*Client) MarkdownPullLink ¶ added in v0.13.0
func (b *Client) MarkdownPullLink(pull models.PullRequest) (string, error)
MarkdownPullLink specifies the character used in a pull request comment.
func (*Client) MergePull ¶ added in v0.4.14
func (b *Client) MergePull(logger logging.SimpleLogging, pull models.PullRequest, _ models.PullRequestOptions) error
MergePull merges the pull request.
func (*Client) PullIsApproved ¶
func (b *Client) PullIsApproved(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest) (approvalStatus models.ApprovalStatus, err error)
PullIsApproved returns true if the merge request was approved.
func (*Client) PullIsMergeable ¶ added in v0.4.13
func (b *Client) PullIsMergeable(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, _ string) (bool, error)
PullIsMergeable returns true if the merge request has no conflicts and can be merged.
func (*Client) ReactToComment ¶ added in v0.24.0
func (b *Client) ReactToComment(_ logging.SimpleLogging, _ models.Repo, _ int, _ int64, _ string) error
UpdateComment updates the body of a comment on the merge request.
func (*Client) SupportsSingleFileDownload ¶ added in v0.15.0
func (*Client) UpdateStatus ¶
func (b *Client) UpdateStatus(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, status models.CommitStatus, src string, description string, url string) error
UpdateStatus updates the status of a commit.
type Comment ¶
type Comment struct {
Content *CommentContent `json:"content,omitempty" validate:"required"`
}
type CommentContent ¶
type CommentContent struct {
Raw *string `json:"raw,omitempty" validate:"required"`
}
type CommentEvent ¶
type CommentEvent struct { CommonEventData Comment *Comment `json:"comment,omitempty" validate:"required"` }
type CommonEventData ¶
type CommonEventData struct { Actor *Actor `json:"actor,omitempty" validate:"required"` Repository *Repository `json:"repository,omitempty" validate:"required"` PullRequest *PullRequest `json:"pullrequest,omitempty" validate:"required"` }
type DiffStat ¶
type DiffStat struct { Values []DiffStatValue `json:"values,omitempty" validate:"required"` Next *string `json:"next,omitempty"` }
type DiffStatFile ¶
type DiffStatFile struct {
Path *string `json:"path,omitempty" validate:"required"`
}
type DiffStatValue ¶
type DiffStatValue struct { Status *string `json:"status,omitempty" validate:"required"` // Old is the old file, this can be null. Old *DiffStatFile `json:"old,omitempty"` // New is the new file, this can be null. New *DiffStatFile `json:"new,omitempty"` }
type Participant ¶
type PullRequest ¶
type PullRequest struct { ID *int `json:"id,omitempty" validate:"required"` Source *BranchMeta `json:"source,omitempty" validate:"required"` Destination *BranchMeta `json:"destination,omitempty" validate:"required"` Participants []Participant `json:"participants,omitempty" validate:"required"` Links *Links `json:"links,omitempty" validate:"required"` State *string `json:"state,omitempty" validate:"required"` Author *Author `jsonN:"author,omitempty" validate:"required"` }
type PullRequestEvent ¶
type PullRequestEvent struct {
CommonEventData
}