GitLab
The GitLab Retriever will perform an HTTP Request to the GitLab API to get your flags.
tip
GitLab has rate limits, be sure to correctly set your PollingInterval
to avoid reaching the limit.
Example
err := ffclient.Init(ffclient.Config{
PollingInterval: 3 * time.Second,
Retriever: &gitlabretriever.Retriever{
RepositorySlug: "thomaspoignant/go-feature-flag",
Branch: "main",
FilePath: "testdata/flag-config.goff.yaml",
GitlabToken: "XXXX",
Timeout: 2 * time.Second,
BaseURL: "https://gitlab.com",
},
})
defer ffclient.Close()
Configuration fields
To configure the access to your GitLab file:
Field | Description |
---|---|
BaseURL | (optional) The domain name of your Gitlab instance Default: https://gitlab.com |
RepositorySlug | Your Gitlab slug org/repo-name . |
FilePath | The path of your file. |
Branch | (optional) The branch where your file is. Default: main |
GitlabToken | (optional) GitLab token is used to access a private repository |
Timeout | (optional) Timeout for the HTTP call Default: 10 seconds |