bbinstance

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackendTypeCloud  = "cloud"
	BackendTypeServer = "server"
)

Recognised values for HostConfig.BackendType. Empty string means "infer from hostname".

Variables

This section is empty.

Functions

func CloudHTTPSURL

func CloudHTTPSURL(namespace, slug string) string

CloudHTTPSURL builds https://bitbucket.org/NAMESPACE/SLUG.git

func CloudRESTBase

func CloudRESTBase() string

CloudRESTBase returns the Bitbucket Cloud REST API v2.0 base URL.

func CloudSSHURL

func CloudSSHURL(namespace, slug string) string

CloudSSHURL builds git@bitbucket.org:NAMESPACE/SLUG.git

func CloudWebPRURL

func CloudWebPRURL(namespace, slug string, id int) string

CloudWebPRURL builds https://bitbucket.org/NAMESPACE/SLUG/pull-requests/ID

func CloudWebRepoURL

func CloudWebRepoURL(namespace, slug string) string

CloudWebRepoURL builds https://bitbucket.org/NAMESPACE/SLUG

func HTTPSURL

func HTTPSURL(host, project, slug string) string

HTTPSURL builds https://HOST/scm/PROJECT/REPO.git

func IsCloud

func IsCloud(hostname, backendType string) bool

IsCloud returns true when the hostname or backendType indicates Bitbucket Cloud. Rules (in order):

  1. backendType == "cloud" → always true
  2. backendType is any non-empty, non-"cloud" value (e.g. "server", "datacenter") → false
  3. No backendType: hostname == "bitbucket.org" (exact, no port) → true
  4. Everything else → false

func RESTBase

func RESTBase(host string) string

RESTBase builds https://HOST/rest/api/1.0

func SSHURL

func SSHURL(host, project, slug string) string

SSHURL builds git@HOST:PROJECT/REPO.git

func SupportsDraftPR

func SupportsDraftPR(version string) bool

SupportsDraftPR returns true if version >= "7.17.0".

func WebPRURL

func WebPRURL(host, project, slug string, id int) string

WebPRURL builds https://HOST/projects/PROJECT/repos/SLUG/pull-requests/ID

func WebRepoURL

func WebRepoURL(host, project, slug string) string

WebRepoURL builds https://HOST/projects/PROJECT/repos/SLUG/browse

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL