Skip to content

Commit bd43b56

Browse files
author
Dave Johnston
committed
[FFM-3363]: Update default config options in docs (harness#85)
1 parent 47fc7f7 commit bd43b56

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/further_reading.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,40 @@
22

33
Covers advanced topics (different config options and scenarios)
44

5+
## Configuration Options
6+
The following configuration options are available to control the behaviour of the SDK.
7+
You can provide options by passing them in when the client is created e.g.
8+
9+
```golang
10+
// Create Options
11+
client, err := harness.NewCfClient(myApiKey,
12+
harness.WithURL("https://config.ff.harness.io/api/1.0"),
13+
harness.WithEventsURL("https://events.ff.harness.io/api/1.0"),
14+
harness.WithPullInterval(1),
15+
harness.WithStreamEnabled(false))
16+
17+
```
18+
19+
| Name | Config Option | Description | default |
20+
|-----------------|----------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
21+
| baseUrl | harness.WithURL("https://config.ff.harness.io/api/1.0") | the URL used to fetch feature flag evaluations. You should change this when using the Feature Flag proxy to http://localhost:7000 | https://config.ff.harness.io/api/1.0 |
22+
| eventsUrl | harness.WithEventsURL("https://events.ff.harness.io/api/1.0"), | the URL used to post metrics data to the feature flag service. You should change this when using the Feature Flag proxy to http://localhost:7000 | https://events.ff.harness.io/api/1.0 |
23+
| pollInterval | harness.WithPullInterval(1)) | when running in stream mode, the interval in minutes that we poll for changes. | 60 |
24+
| enableStream | harness.WithStreamEnabled(false), | Enable streaming mode. | true |
25+
| enableAnalytics | *Not Supported* | Enable analytics. Metrics data is posted every 60s | *Not Supported* |
26+
27+
## Logging Configuration
28+
You can provide your own logger to the SDK, passing it in as a config option.
29+
The following example creates an instance of the logrus logger and provides it as an option.
30+
31+
32+
```golang
33+
logger := logrus.New()
34+
35+
// Create a feature flag client
36+
client, err := harness.NewCfClient(myApiKey, harness.WithLogger(logger))
37+
```
38+
539
## Recommended reading
640

741
[Feature Flag Concepts](https://ngdocs.harness.io/article/7n9433hkc0-cf-feature-flag-overview)

0 commit comments

Comments
 (0)