Skip to main content
Version: v1.40.0

Bitbucket

Overview​

Fetch the configuration from files stored in a GIT repository.
tip

Bitbucket has rate limits, be sure to correctly set your PollingInterval to avoid reaching the limit.

Configure the relay proxy​

To configure your relay proxy to use the Bitbucket retriever, you need to add the following configuration to your relay proxy configuration file:

goff-proxy.yaml
# ...
retrievers:
- kind: bitbucket
repositorySlug: thomaspoignant/go-feature-flag
path: config/flag/my-flags.yaml
# ...
Field nameMandatoryTypeDefaultDescription
kindstringnoneValue should be bitbucket.
This field is mandatory and describes which retriever you are using.
repositorySlugstringnoneThe repository slug of the Bitbucket repository where your file is located (ex: thomaspoignant/go-feature-flag).
pathstringnonePath to the file inside the repository (ex: config/flag/my-flags.yaml).
baseUrlstringhttps://gitlab.comThe base URL of your Bitbucket instance
By default we are using the public API https://api.bitbucket.org.
branchstringmainThe branch we should check in the repository.
tokenstringnoneBitbucket token used to access a private repository (Create a Repository Access Token).
timeoutstring10000Timeout in millisecond used when calling GitLab.

Configure the GO Module​

To configure your GO module to use the Bitbucket retriever, you need to add the following configuration to your ffclient.Config{} object:

example.go
err := ffclient.Init(ffclient.Config{
PollingInterval: 3 * time.Second,
Retriever: &bitbucketretriever.Retriever{
RepositorySlug: "thomaspoignant/go-feature-flag",
Branch: "main",
FilePath: "testdata/flag-config.goff.yaml",
BitBucketToken: "XXXX",
Timeout: 2 * time.Second,
},
})
defer ffclient.Close()
FieldMandatoryDescription
RepositorySlugYour Gitlab slug org/repo-name.
FilePathThe path of your file.
BaseURLThe domain name of your Bitbucket instance
Default: https://api.bitbucket.org
BranchThe branch where your file is.
Default: main
BitBucketTokenBitbucket token is used to access a private repository
TimeoutTimeout for the HTTP call
Default: 10 seconds