Documentation ¶
Overview ¶
Package bitbucket implements the client for Bitbucket Cloud.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct { Type string `json:"type"` User User `json:"user,omitempty"` Role string `json:"role,omitempty"` Approved *bool `json:"approved,omitempty"` State any `json:"state,omitempty"` ParticipatedOn string `json:"participated_on,omitempty"` }
Actor is a Bitbucket actor.
type Branch ¶
type Branch struct { Name string `json:"name"` MergeStrategies []string `json:"merge_strategies"` DefaultMergeStrategy string `json:"default_merge_strategy"` }
Branch is a Bitbucket branch.
type Client ¶
type Client struct { // BaseURL is the base URL used to construct the final URL of endpoints. // For Bitbucket Cloud, it should be https://api.bitbucket.org/2.0 BaseURL string // HTTPClient is the HTTP client used to make requests. // if not set, a new http.Client is used on each request. HTTPClient *http.Client // Token is the Bitbucket Cloud token. Token string // Workspace is the Bitbucket Cloud workspace. Workspace string // RepoSlug is the Bitbucket Cloud repository slug. RepoSlug string }
Client is a Bitbucket Cloud client.
func (*Client) GetPullRequest ¶
GetPullRequest fetches a pull request by its ID.
type Commit ¶
type Commit struct { ShortHash string `json:"hash"` // Note: this is not part of the Bitbucket API response. // This is fetched from the commit API and stored here for convenience. SHA string }
Commit is a Bitbucket commit.
type Links ¶
type Links struct { Self *struct { Href string `json:"href,omitempty"` } `json:"self"` HTML *struct { Href string `json:"href,omitempty"` } `json:"html"` Avatar *struct { Href string `json:"href,omitempty"` } `json:"avatar"` }
Links is a collection of Bitbucket links.
type PR ¶
type PR struct { Type string `json:"type"` ID int `json:"id"` Title string `json:"title"` Rendered Rendered `json:"rendered"` Summary Summary `json:"summary"` State string `json:"state"` Author User `json:"author"` Source TargetBranch `json:"source"` Destination TargetBranch `json:"destination"` MergeCommit Commit `json:"merge_commit"` CommentCount int `json:"comment_count"` TaskCount int `json:"task_count"` CloseSourceBranch bool `json:"close_source_branch"` ClosedBy *Actor `json:"closed_by,omitempty"` Reason string `json:"reason"` CreatedOn string `json:"created_on"` UpdatedOn string `json:"updated_on"` Reviewers []Actor `json:"reviewers"` Participants []Actor `json:"participants"` Links Links `json:"links"` }
PR is a Bitbucket Pull Request.
type PullRequestResponse ¶
type PullRequestResponse struct { Size int `json:"size"` Page int `json:"page"` PageLen int `json:"pagelen"` Next string `json:"next"` Previous string `json:"previous"` Values []PR `json:"values"` }
PullRequestResponse is the response of a pull request list.
type Rendered ¶
type Rendered struct { Title RenderedContent `json:"title"` Description RenderedContent `json:"description"` Reason RenderedContent `json:"reason"` }
Rendered is the rendered version of the PR metadata.
type RenderedContent ¶
type RenderedContent struct { Raw string `json:"raw"` Markup string `json:"markup"` HTML string `json:"html"` }
RenderedContent is the rendered version of the PR content.
type TargetBranch ¶
type TargetBranch struct { Repository struct { Type string `json:"type"` } Branch Branch `json:"branch"` Commit Commit `json:"commit"` }
TargetBranch is the source or destination branch of a pull request.
Click to show internal directories.
Click to hide internal directories.