Skip to content

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:

yaml
# ...
retrievers:
  - kind: bitbucket
    repositorySlug: your-org/your-repo
    path: config/flag/my-flags.yaml
# ...
Field nameMandatoryTypeDefaultDescription
kindYesstringnoneValue should be bitbucket.
This field is mandatory and describes which retriever you are using.
repositorySlugYesstringnoneThe repository slug of the Bitbucket repository where your file is located (ex: your-org/your-repo).
pathYesstringnonePath to the file inside the repository (ex: config/flag/my-flags.yaml).
baseUrlNostringhttps://api.bitbucket.orgThe base URL of your Bitbucket instance
By default we are using the public API https://api.bitbucket.org.
branchNostringmainThe branch we should check in the repository.
tokenNostringnoneBitbucket token used to access a private repository (Create a Repository Access Token).
timeoutNostring10000Timeout 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:

go
client, err := ffclient.New(&ffclient.Config{
    PollingInterval: 3 * time.Second,
    Retriever: &bitbucketretriever.Retriever{
        RepositorySlug: "your-org/your-repo",
        Branch: "main",
        FilePath: "testdata/flag-config.yaml",
        BitBucketToken: "XXXX",
        Timeout: 2 * time.Second,
    },
})
defer client.Close()
FieldMandatoryDescription
RepositorySlugYesYour Gitlab slug org/repo-name.
FilePathYesThe path of your file.
BaseURLNoThe domain name of your Bitbucket instance
Default: https://api.bitbucket.org
BranchNoThe branch where your file is.
Default: main
BitBucketTokenNoBitbucket token is used to access a private repository
TimeoutNoTimeout for the HTTP call
Default: 10 seconds

Released under the MIT License.