Releases: configcat/go-sdk
Releases · configcat/go-sdk
v7.5.0
v7.4.2
v7.4.1
v7.4.0
v7.3.0
v7.2.0
v7.1.0
v7.0.0
Breaking changes:
Here is the list of breaking API changes compared to v6:
Configuration:
- When using the
configcat.NewCustomClient(config)
function, theSDKKey
is moved to theconfig
struct. - The configuration of Polling modes changed:
- AutoPoll:
configcat.Config{SDKKey: "<PLACE-YOUR-SDK-KEY-HERE>", PollingMode: configcat.AutoPoll, PollInterval: time.Second * 120 /* polling interval in seconds */}
- Lazy:
configcat.Config{SDKKey: "<PLACE-YOUR-SDK-KEY-HERE>", PollingMode: configcat.Lazy, PollInterval: time.Second * 120 /* cache TTL in seconds */}
- Manual:
configcat.Config{SDKKey: "<PLACE-YOUR-SDK-KEY-HERE>", PollingMode: configcat.Manual}
- Added a new configuration option
ChangeNotify
to subscribe to configuration changes.configcat.Config{SDKKey: "<PLACE-YOUR-SDK-KEY-HERE>", ChangeNotify: func() { // here you can subscribe to configuration changes }}
Evaluation of a feature flag / setting value:
- The
GetValue()
,GetValueForUser()
generic methods were replaced by typed ones that accept an optionalUser
parameter:GetBoolValue(key string, defaultValue bool, user User) bool GetIntValue(key string, defaultValue int, user User) int GetFloatValue(key string, defaultValue float64, user User) float64 GetStringValue(key string, defaultValue string, user User) string
When you don't want to pass a
User
, just use these methods withnil
as theUser
parameter. - All
*Async
methods were removed, due to the fact that all Sync methdos could be used in Async context with goroutines.
Other changes
- The
Refresh(context)
method now gets acontext.Context
parameter. - Added a new
RefreshIfOlder(context, time)
method to give more control over when the local cache gets updated. - The
ConfigCache
interface methods now gets an additionalcontext.Context
parameter. - The way of the
User
object creation changed:- Old:
user := configcat.NewUser("<USER-IDENTIFIER>")
- New:
user := &configcat.UserData{Identifier: "<USER-IDENTIFIER>"}
- Old:
New features:
- Introduced new options to create a
User
object, here you can read more. - Introduced Snapshots, here you can read more.
Included PRs:
- #27 v7: refactor config fetching and Client API
- #30 v7: reflection-based API
- #31 v7: add get-only benchmark
- #32 v7: implement snapshots
- #33 v7: add generic value-get methods
- #34 v7: avoid panic when nil snapshot is used
- #35 v7: avoid copying mutex when copying configuration
- #36 v7: always refresh when asked
Special thanks to @rogpeppe for the contribution!
v6.1.1
v6.1.0
Code quality and performance improvements from these PRs:
- #13 more efficient evaluation
- #15 simplify client logic
- #16 remove policy factory
- #17 use less embedding in policy implementations
- #18 return pointer fron newConfigRefresher
- #19 simplify configFetcher code slightly
- #20 refactor async code
- #21 avoid internal tests
- #22 more external tests
- #23 preprocess config for evaluation
- #24 restore missed logging messages
Special thanks to @rogpeppe for the contribution and the massive amount of work on these PRs.