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
configcattest
package,Published by z4kn4fein 7 months ago
To unidentified users
value in case of invalid config JSONs.Published by z4kn4fein 7 months ago
PercentageOption
collection on the Flag
struct of the configcattest
package.Published by z4kn4fein 10 months ago
pkg.go.dev
Published by z4kn4fein 10 months ago
Published by z4kn4fein 10 months ago
Published by z4kn4fein 10 months ago
config-json convert v5-to-v6
command of the ConfigCat CLI tool.MatchedEvaluationRule
field to MatchedTargetingRule
and the MatchedEvaluationPercentageRule
field to MatchedPercentageOption
in EvaluationDetailsData
.UserAttributes
interface: GetAttribute(attr string) string
-> GetAttribute(attr string) interface{}
Custom
field of UserData
: map[string]string
-> map[string]interface{}
map[string]interface{}
as the User in evaluation functions was added.Logger
interface:
type Logger interface {
GetLevel() LogLevel
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warnf(format string, args ...interface{})
Errorf(format string, args ...interface{})
}
type Logger interface {
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warnf(format string, args ...interface{})
Errorf(format string, args ...interface{})
}
Client
initialization config:
config := configcat.Config{
LogLevel: LogLevelInfo,
// PollingMode: configcat.AutoPoll,
// etc.
}
LogLevel
type alias were changed:
LogLevelDebug LogLevel = -2
LogLevelInfo LogLevel = -1
LogLevelWarn LogLevel = 0 // default level
LogLevelError LogLevel = 1
LogLevelNone LogLevel = 2
logrus
. It was replaced by a simple logger built upon the log
package.Published by z4kn4fein about 1 year ago
gopkg.in/yaml.v3
to v3.0.1
due to vulnerability report.Published by z4kn4fein over 1 year ago
Ready()
function. It returns a channel that closes when the SDK reaches the ready state.
Manual
or Lazy
, the SDK is considered ready right after instantiation.AutoPoll
, the SDK is considered ready when the first initial HTTP request is finished.GetVariationID() / GetVariationIDs()
methods. Alternative: Get[Type]ValueDetails() / GetAllValueDetails()
.ChangeNotify
callback function. Alternative: Hooks.OnConfigChanged
.Published by z4kn4fein over 1 year ago
ErrKeyNotFound
when a flag requested is missing.EvaluationDetails
result.Published by z4kn4fein over 1 year ago
Published by z4kn4fein over 1 year ago
Published by z4kn4fein over 1 year ago
v7.8.2
. It's useful to repeat the cache writes, even in the case of 304. The cache could be in a clean state (e.g., due to a restart) that we should update with the latest in-memory config
.Published by z4kn4fein over 1 year ago
Published by z4kn4fein over 1 year ago
X-ConfigCat-UserAgent
header.Published by z4kn4fein almost 2 years ago
SetOffline()
/ SetOnline()
methods to extend the functionality of offline mode with switching between modes runtime.Published by z4kn4fein almost 2 years ago
Offline
configuration option to indicate whether the SDK is allowed to make HTTP calls or not. In 'offline' mode, the SDK works from the cache only.Hooks
configuration option that allows subscribing to OnConfigChanged
/ OnFlagEvaluated(EvaluationDetails)
/ OnError(String)
events.GetValueDetails()
/ GetAllValueDetails()
methods to retrieve evaluation details of feature flags/settings. The details include:
Value
: The evaluated feature flag's value.Key
: The evaluated feature flag's key.User
: The user used for evaluation.VariationId
: The diagnostic ID of the targeting, percentage, or default rule the evaluation was based on.IsDefaultValue
: True when the default value passed to GetValue()
or GetValueDetails()
is returned.Error
: The error when the evaluation fails otherwise, nil.FetchTime
: The time when the last config was fetched.MatchedEvaluationRule
: If the evaluation was based on a targeting rule, this field contains that specific rule.MatchedEvaluationPercentageRule
: If the evaluation was based on a percentage rule, this field contains that specific rule.GetVariationID()
/ GetAllVariationIDs()
methods became deprecated in favor of GetValueDetails()
/ GetAllValueDetails()
.Published by z4kn4fein over 2 years ago
FetchTime()
on Snapshot
)Published by z4kn4fein over 2 years ago
Published by z4kn4fein over 2 years ago
GetAllValues()
function that evaluates all flags & settings in a map[string]interface{}
.FlagOverrides
configuration option to support the reading of flags & settings from a local file or from a map[string]interface{}
.