Documentation
¶
Index ¶
- type AppProperties
- type Branch
- type BranchCreator
- type BranchDeleter
- type BranchLister
- type Client
- type Commit
- type CommitLister
- type CommitReader
- type CreateBranchInput
- type CreatePRInput
- type CreateRepoInput
- type CreateTagInput
- type HTTPError
- type MergePRInput
- type PRApprover
- type PRChangesRequester
- type PRCreator
- type PRDecliner
- type PRDiffer
- type PREditor
- type PRLister
- type PRMerger
- type PRReader
- type PRReadier
- type PRReviewRequester
- type PRUnapprover
- type Pipeline
- type PipelineClient
- type PullRequest
- type RepoDeleter
- type RepoLister
- type RepoReader
- type RepoWriter
- type Repository
- type RunPipelineInput
- type ServerCapabilities
- type Tag
- type TagCreator
- type TagDeleter
- type TagLister
- type UpdatePRInput
- type User
- type UserGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppProperties ¶
AppProperties holds Bitbucket server version metadata.
type BranchCreator ¶
type BranchCreator interface {
CreateBranch(ns, slug string, in CreateBranchInput) (Branch, error)
}
BranchCreator can create branches.
type BranchDeleter ¶
BranchDeleter can delete branches.
type BranchLister ¶
BranchLister can list branches.
type Client ¶
type Client interface {
RepoLister
RepoReader
RepoWriter
RepoDeleter
PRLister
PRReader
PRCreator
PRMerger
PRApprover
PRDiffer
BranchLister
BranchCreator
BranchDeleter
TagLister
TagCreator
TagDeleter
PREditor
PRDecliner
PRUnapprover
PRReadier
PRReviewRequester
UserGetter
CommitLister
CommitReader
}
Client is the full Bitbucket backend interface.
type Commit ¶
type Commit struct {
Hash string
Message string // subject line only (first line of commit message)
Author User
Timestamp time.Time
WebURL string
}
Commit is the domain representation of a single repository commit.
type CommitLister ¶
CommitLister can list commits for a branch.
type CommitReader ¶
CommitReader can fetch a single commit by hash.
type CreateBranchInput ¶
CreateBranchInput carries the parameters for creating a branch.
type CreatePRInput ¶
type CreatePRInput struct {
Title string
Description string
Draft bool
FromBranch string
ToBranch string
}
CreatePRInput carries the parameters for creating a pull request.
type CreateRepoInput ¶
CreateRepoInput carries the parameters for creating a repository.
type CreateTagInput ¶
type CreateTagInput struct {
Name string
StartAt string // branch name or commit hash
Message string // empty = lightweight tag; non-empty = annotated tag
}
CreateTagInput carries the parameters for creating a tag.
type MergePRInput ¶
MergePRInput carries the parameters for merging a pull request.
type PRApprover ¶
PRApprover can approve pull requests.
type PRChangesRequester ¶
PRChangesRequester can request changes on a pull request (Cloud only). Access via type assertion — not embedded in Client.
type PRCreator ¶
type PRCreator interface {
CreatePR(ns, slug string, in CreatePRInput) (PullRequest, error)
}
PRCreator can create pull requests.
type PRDecliner ¶
PRDecliner can decline pull requests.
type PREditor ¶
type PREditor interface {
UpdatePR(ns, slug string, id int, in UpdatePRInput) (PullRequest, error)
}
PREditor can update pull request metadata.
type PRLister ¶
type PRLister interface {
ListPRs(ns, slug, state string, limit int) ([]PullRequest, error)
}
PRLister can list pull requests.
type PRMerger ¶
type PRMerger interface {
MergePR(ns, slug string, id int, in MergePRInput) (PullRequest, error)
}
PRMerger can merge pull requests.
type PRReader ¶
type PRReader interface {
GetPR(ns, slug string, id int) (PullRequest, error)
}
PRReader can fetch a single pull request.
type PRReviewRequester ¶
PRReviewRequester can request reviewers on a pull request.
type PRUnapprover ¶
PRUnapprover can remove approval from pull requests.
type Pipeline ¶
type Pipeline struct {
UUID string
BuildNumber int
State string // PENDING, IN_PROGRESS, SUCCESSFUL, FAILED, ERROR, STOPPED
RefType string // "branch", "tag", "commit"
RefName string
CreatedOn string
Duration int // seconds
WebURL string
}
Pipeline is the domain representation of a Bitbucket Cloud pipeline run.
type PipelineClient ¶
type PipelineClient interface {
ListPipelines(ns, slug string, limit int) ([]Pipeline, error)
GetPipeline(ns, slug, uuid string) (Pipeline, error)
RunPipeline(ns, slug string, in RunPipelineInput) (Pipeline, error)
}
PipelineClient is implemented only by Bitbucket Cloud clients.
func AsPipelineClient ¶
func AsPipelineClient(c Client) (PipelineClient, error)
AsPipelineClient returns the PipelineClient view of c, or an error if the backend does not support pipelines (i.e. is not Bitbucket Cloud).
type PullRequest ¶
type PullRequest struct {
ID int
Title string
Description string
State string
Draft bool
Author User
FromBranch string
ToBranch string
WebURL string
}
PullRequest is the domain representation of a Bitbucket pull request.
type RepoDeleter ¶
RepoDeleter can delete repositories.
type RepoLister ¶
type RepoLister interface {
ListRepos(limit int) ([]Repository, error)
}
RepoLister can list repositories.
type RepoReader ¶
type RepoReader interface {
GetRepo(ns, slug string) (Repository, error)
}
RepoReader can fetch a single repository.
type RepoWriter ¶
type RepoWriter interface {
CreateRepo(ns string, in CreateRepoInput) (Repository, error)
}
RepoWriter can create repositories.
type Repository ¶
Repository is the domain representation of a Bitbucket repository.
type RunPipelineInput ¶
type RunPipelineInput struct {
Branch string
}
RunPipelineInput carries the parameters for triggering a pipeline run.
type ServerCapabilities ¶
type ServerCapabilities interface {
GetApplicationProperties() (AppProperties, error)
}
ServerCapabilities is implemented only by Bitbucket Data Center clients.
type Tag ¶
type Tag struct {
Name string
Hash string
Message string // empty for lightweight tags; first line for annotated
WebURL string
}
Tag is the domain representation of a repository tag.
type TagCreator ¶
type TagCreator interface {
CreateTag(ns, slug string, in CreateTagInput) (Tag, error)
}
TagCreator can create tags.
type TagDeleter ¶
TagDeleter can delete tags.
type UpdatePRInput ¶
type UpdatePRInput struct {
Title string // empty = no change
Description string // empty = no change
}
UpdatePRInput carries the parameters for editing a pull request.
type UserGetter ¶
UserGetter can retrieve the currently authenticated user.