Releases: thomaspoignant/go-feature-flag
Releases · thomaspoignant/go-feature-flag
v0.9.1
v0.9.0
v0.9.0
Features
- #75 - Send a Slack message when a flag has changed.
⚠️ Breaking changes
- #74 - Deprecate the
Webhooks
field in the configuration to have the fieldNotifiers
instead
Migration
If you were using Webhooks
before, you should have a configuration like this:
ffclient.Init(ffclient.Config{
Retriever: &ffclient.FileRetriever{Path: "testdata/flag-config.yaml"},
FileFormat: "yaml",
Webhooks: []ffclient.WebhookConfig{
{
PayloadURL: " https://example.com/hook",
Secret: "Secret",
Meta: map[string]string{
"app.name": "my app",
},
},
},
}
With Notifiers
, your configuration should looks like this now:
ffclient.Init(ffclient.Config{
Retriever: &ffclient.FileRetriever{Path: "testdata/flag-config.yaml"},
FileFormat: "yaml",
Notifiers: []ffclient.NotifierConfig{
&ffclient.WebhookConfig{
PayloadURL: " https://example.com/hook",
Secret: "Secret",
Meta: map[string]string{
"app.name": "my app",
},
},
},
}
Changes
v0.8.1
v0.8.0
v0.7.0
v0.6.1
v0.6.0
v0.5.0
v0.5.0
⚠️ Breaking changes
- #49 - Change the signature to pass the retriever in the config. See the pull request (#49) to have the full details and to see how to migrate from
v0.4.1
tov0.5.0
.
Why?
The main reason is to have the aws/aws-sdk-go
as a dependency only if you are using the S3Retriever
. With this new syntax, we don't force you to have the SDK if you are not using it.
How to migrate
If you were using HTTPRetriever
, S3Retriever
or GithubRetriever
, the change consists only of changing the key in the config.
// Before v0.5.0
err := ffclient.Init(ffclient.Config{
PollInterval: 3,
HTTPRetriever: &ffClient.HTTPRetriever{
URL: "http://example.com/test.yaml",
},
})
// Since v0.5.0
err := ffclient.Init(ffclient.Config{
PollInterval: 3,
Retriever: &ffclient.HTTPRetriever{
URL: "http://example.com/test.yaml",
},
})
It is a bit different for the flag configuration, I have introduced a FileRetriever
to keep the same format for all retrievers.
// Before v0.5.0
err := ffclient.Init(ffclient.Config{
PollInterval: 3,
LocalFile: "file-example.yaml",
})
// Since v0.5.0
err := ffclient.Init(ffclient.Config{
PollInterval: 3,
Retriever: &ffclient.FileRetriever{
Path: "file-example.yaml",
},
})
Features
- #47 - Add a
Timeout
properties to specify timeout when calling HTTP Client retriever, default is 10 seconds. - #48 - Use context when retrieving the flags,
Context
could be passed in theffclient.Config{}
during initialization.
Internal
- #46 - Rename and un-export UserToJSON
v0.4.1
v0.4.1
Fix typo in the documentation.