Documentation
¶
Overview ¶
Package bitbucket is the source adapter for Bitbucket Cloud and Bitbucket Data Center (R-091). The host decides which: bitbucket.org is Cloud, any other host is a Data Center server. It signs in with an access token or an API token, with an OAuth consumer (Cloud), or with an SSH access key.
Index ¶
- Constants
- func Info() api.KindInfo
- type Adapter
- func (a *Adapter) BeginAuthorization(_ context.Context, req api.AuthorizationRequest) (api.Authorization, error)
- func (a *Adapter) Category() api.Category
- func (a *Adapter) CompleteAuthorization(ctx context.Context, req api.AuthorizationCompletion) (api.AuthorizationResult, error)
- func (a *Adapter) Configure(_ context.Context, raw json.RawMessage) error
- func (a *Adapter) Covers(repoURL string) int
- func (a *Adapter) GitCredential(ctx context.Context, repoURL string) (api.GitCredential, error)
- func (a *Adapter) HealthCheck(context.Context) error
- func (a *Adapter) Kind() string
- func (a *Adapter) ListBranches(ctx context.Context, repoURL string) ([]string, error)
- func (a *Adapter) ListRepositories(ctx context.Context, req api.ListRepositoriesRequest) ([]api.Repository, error)
- func (a *Adapter) Refresh(ctx context.Context) (map[string]secret.Value, error)
- func (a *Adapter) SourceCapabilities() api.SourceCapabilities
Constants ¶
const Kind = "bitbucket"
Kind is the adapter's kind string.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter is one connection to Bitbucket Cloud or a Bitbucket Data Center.
func (*Adapter) BeginAuthorization ¶
func (a *Adapter) BeginAuthorization(_ context.Context, req api.AuthorizationRequest) (api.Authorization, error)
BeginAuthorization sends the person's browser to Bitbucket Cloud.
func (*Adapter) CompleteAuthorization ¶
func (a *Adapter) CompleteAuthorization(ctx context.Context, req api.AuthorizationCompletion) (api.AuthorizationResult, error)
CompleteAuthorization exchanges the code the callback received.
func (*Adapter) Covers ¶
Covers scores the address by workspace (Cloud) or project key (Data Center).
func (*Adapter) GitCredential ¶
GitCredential is the token, the OAuth token (refreshed here), or the key.
func (*Adapter) HealthCheck ¶
HealthCheck succeeds once configured. Whether the credential still works is learned at the next clone or listing, which reports it (R-146).
func (*Adapter) ListBranches ¶
ListBranches lists a repository's branches.
func (*Adapter) ListRepositories ¶
func (a *Adapter) ListRepositories(ctx context.Context, req api.ListRepositoriesRequest) ([]api.Repository, error)
ListRepositories lists repositories the credential can read, in the workspace or project when the connection is limited to one.
func (*Adapter) Refresh ¶
Refresh renews an expired OAuth access token and returns the tokens to store. Nil for every other method, and for a token still good.
func (*Adapter) SourceCapabilities ¶
func (a *Adapter) SourceCapabilities() api.SourceCapabilities