ConfigCat SDK for Go. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
MIT License
Published by z4kn4fein over 2 years ago
Published by z4kn4fein over 2 years ago
X-ConfigCat-UserAgent
header.Published by z4kn4fein over 2 years ago
Published by z4kn4fein over 2 years ago
Thanks to @rogpeppe for the contribution!
Published by z4kn4fein almost 3 years ago
.Key()
accessor was added to each flag type. #43Thanks to @rogpeppe for the contribution!
Published by z4kn4fein almost 3 years ago
Snapshot
from already known values. #41Special thanks to @rogpeppe for the improvements.
Published by z4kn4fein over 3 years ago
Here is the list of breaking API changes compared to v6:
configcat.NewCustomClient(config)
function, the SDKKey
is moved to the config
struct.configcat.Config{SDKKey: "<PLACE-YOUR-SDK-KEY-HERE>",
PollingMode: configcat.AutoPoll,
PollInterval: time.Second * 120 /* polling interval in seconds */}
configcat.Config{SDKKey: "<PLACE-YOUR-SDK-KEY-HERE>",
PollingMode: configcat.Lazy,
PollInterval: time.Second * 120 /* cache TTL in seconds */}
configcat.Config{SDKKey: "<PLACE-YOUR-SDK-KEY-HERE>",
PollingMode: configcat.Manual}
ChangeNotify
to subscribe to configuration changes.
configcat.Config{SDKKey: "<PLACE-YOUR-SDK-KEY-HERE>",
ChangeNotify: func() {
// here you can subscribe to configuration changes
}}
GetValue()
, GetValueForUser()
generic methods were replaced by typed ones that accept an optional User
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.
*Async
methods were removed, due to the fact that all Sync methdos could be used in Async context with goroutines.Refresh(context)
method now gets a context.Context
parameter.RefreshIfOlder(context, time)
method to give more control over when the local cache gets updated.ConfigCache
interface methods now gets an additional context.Context
parameter.User
object creation changed:
user := configcat.NewUser("<USER-IDENTIFIER>")
user := &configcat.UserData{Identifier: "<USER-IDENTIFIER>"}
User
object, here you can read more.Special thanks to @rogpeppe for the contribution!
Published by z4kn4fein almost 4 years ago
Revert to Contains semantics when isOneOf
or isNotOneOf
comparators are used to evaluate a user attribute.
Published by z4kn4fein almost 4 years ago
Code quality and performance improvements from these PRs:
Special thanks to @rogpeppe for the contribution and the massive amount of work on these PRs.
Published by z4kn4fein almost 4 years ago
Published by z4kn4fein almost 4 years ago
Published by z4kn4fein about 4 years ago
Addressing global data handling and processing trends via Data Governance feature. Customers can control the geographic location where their config JSONs get published to. See the docs.
We are introducing a new DataGovernance initialization parameter. Set this parameter to be in sync with the Data Governance preference on the Dashboard.
Breaking change:
Published by z4kn4fein about 4 years ago
Added variation id related functions to support integration with analytical tools:
GetVariationId[Async]()
GetVariationId[Async]ForUser()
GetAllVariationIds[Async]()
GetAllVariationIds[Async]ForUser()
GetKeyAndValue[Async]()
Published by configcat over 4 years ago
Breaking change: Renamed API Key
to SDK Key
.
Published by configcat over 4 years ago
Add option to set the log severity of the default logger
Published by configcat over 4 years ago
Published by configcat over 4 years ago
Published by configcat over 4 years ago
Published by configcat over 4 years ago