Documentation
¶
Index ¶
- Constants
- func CloudAppPasswordsURL() string
- func CloudHTTPSURL(namespace, slug string) string
- func CloudRESTBase() string
- func CloudSSHURL(namespace, slug string) string
- func CloudWebPRURL(namespace, slug string, id int) string
- func CloudWebRepoURL(namespace, slug string) string
- func HTTPSURL(host, project, slug string) string
- func IsCloud(hostname, backendType string) bool
- func PATManageURL(hostname, username string) string
- func RESTBase(host string) string
- func SSHURL(host, project, slug string) string
- func SupportsDraftPR(version string) bool
- func ValidateBackendType(s string) error
- func WebPRURL(host, project, slug string, id int) string
- func WebRepoURL(host, project, slug string) string
Constants ¶
const ( BackendTypeCloud = "cloud" BackendTypeServer = "server" )
Recognised values for HostConfig.BackendType. Empty string means "infer from hostname".
Variables ¶
This section is empty.
Functions ¶
func CloudAppPasswordsURL ¶ added in v1.2.0
func CloudAppPasswordsURL() string
CloudAppPasswordsURL returns the Bitbucket Cloud App Passwords creation URL.
func CloudHTTPSURL ¶
CloudHTTPSURL builds https://bitbucket.org/NAMESPACE/SLUG.git
func CloudRESTBase ¶
func CloudRESTBase() string
CloudRESTBase returns the Bitbucket Cloud REST API v2.0 base URL. BB_CLOUD_BASE_URL overrides the default for test scenarios.
func CloudSSHURL ¶
CloudSSHURL builds git@bitbucket.org:NAMESPACE/SLUG.git
func CloudWebPRURL ¶
CloudWebPRURL builds https://bitbucket.org/NAMESPACE/SLUG/pull-requests/ID
func CloudWebRepoURL ¶
CloudWebRepoURL builds https://bitbucket.org/NAMESPACE/SLUG
func HTTPSURL ¶
HTTPSURL builds https://HOST/scm/PROJECT/REPO.git
func IsCloud ¶
IsCloud returns true when the hostname or backendType indicates Bitbucket Cloud. Rules (in order):
- backendType == "cloud" → always true
- backendType is any non-empty, non-"cloud" value (e.g. "server", "datacenter") → false
- No backendType: hostname == "bitbucket.org" (exact, no port) → true
- Everything else → false
func PATManageURL ¶ added in v1.2.0
PATManageURL returns the URL for managing Personal Access Tokens on a Bitbucket Server / Data Center instance. When username is non-empty the user-scoped path is used (/plugins/servlet/access-tokens/users/{username}/manage), which works across all Bitbucket Server / Data Center versions. The generic /manage path is only used as a fallback when the username is not yet known.
func SupportsDraftPR ¶
SupportsDraftPR returns true if version >= "7.17.0".
func ValidateBackendType ¶ added in v1.73.0
ValidateBackendType returns a non-nil error when s is not a recognised backend_type value. Empty string is valid (auto-detect from hostname).
func WebPRURL ¶
WebPRURL builds https://HOST/projects/PROJECT/repos/SLUG/pull-requests/ID
func WebRepoURL ¶
WebRepoURL builds https://HOST/projects/PROJECT/repos/SLUG/browse
Types ¶
This section is empty.