go-sdk

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

Stars
21
go-sdk - v9.0.6 Latest Release

Published by z4kn4fein 7 months ago

Fixed

  • Generate variation IDs for percentage options in the configcattest package,
go-sdk - v9.0.5

Published by z4kn4fein 7 months ago

Fixed

  • There were cases when a user-based evaluation reported errors even when no user object was passed. This prevented the usage of the flag's To unidentified users value in case of invalid config JSONs.
go-sdk - v9.0.4

Published by z4kn4fein 7 months ago

Added

  • More evaluation tests to ensure consistent functioning with other SDKs.
  • Ability to set a PercentageOption collection on the Flag struct of the configcattest package.
  • Uploading the coverage report to SonarCloud.
go-sdk - v9.0.3

Published by z4kn4fein 10 months ago

  • Only increased version to fixup the latest commit hash on pkg.go.dev
go-sdk - v9.0.2

Published by z4kn4fein 10 months ago

Fixed

  • Reported SDK version.
go-sdk - v9.0.1

Published by z4kn4fein 10 months ago

Fixed

  • Cache key generation.
go-sdk - v9.0.0

Published by z4kn4fein 10 months ago

Added

  • Support for the new Config JSON v6 format: update the config model and implement new features in setting evaluation logic.
  • Consistent evaluation-related logging across SDKs.

Changed

  • The config JSON v5 format is no longer accepted by flag overrides. If you use this feature, you must convert your override JSON file(s) to the v6 format. You can do this using the config-json convert v5-to-v6 command of the ConfigCat CLI tool.
  • Rename the MatchedEvaluationRule field to MatchedTargetingRule and the MatchedEvaluationPercentageRule field to MatchedPercentageOption in EvaluationDetailsData.
  • User object related changes:
    • Signature of UserAttributes interface: GetAttribute(attr string) string -> GetAttribute(attr string) interface{}
    • Type of Custom field of UserData: map[string]string -> map[string]interface{}
    • Support for using map[string]interface{} as the User in evaluation functions was added.
  • Signature of the Logger interface:
    • Before:
      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{})
      }
      
    • After:
      type Logger interface {
          Debugf(format string, args ...interface{})
          Infof(format string, args ...interface{})
          Warnf(format string, args ...interface{})
          Errorf(format string, args ...interface{})
      }
      
    • Option to define the LogLevel is moved to the Client initialization config:
      config := configcat.Config{
           LogLevel: LogLevelInfo,
           // PollingMode: configcat.AutoPoll,
           // etc.
      }
      
    • The constant values related to the LogLevel type alias were changed:
       LogLevelDebug LogLevel = -2
       LogLevelInfo  LogLevel = -1
       LogLevelWarn  LogLevel = 0 // default level
       LogLevelError LogLevel = 1
       LogLevelNone  LogLevel = 2
      

Removed

  • Dependency on logrus. It was replaced by a simple logger built upon the log package.
go-sdk - v8.0.1

Published by z4kn4fein about 1 year ago

  • Increased version of gopkg.in/yaml.v3 to v3.0.1 due to vulnerability report.
go-sdk - v8.0.0

Published by z4kn4fein over 1 year ago

Added

  • Ready() function. It returns a channel that closes when the SDK reaches the ready state.
    • When the polling mode is Manual or Lazy, the SDK is considered ready right after instantiation.
    • When the polling mode is AutoPoll, the SDK is considered ready when the first initial HTTP request is finished.

Changed

  • Standardized config cache key generation algorithm and cache payload format to allow shared caches to be used by SDKs of different platforms.

Removed

  • GetVariationID() / GetVariationIDs() methods. Alternative: Get[Type]ValueDetails() / GetAllValueDetails().
  • ChangeNotify callback function. Alternative: Hooks.OnConfigChanged.
go-sdk - v7.10.1

Published by z4kn4fein over 1 year ago

  • #61 Return ErrKeyNotFound when a flag requested is missing.
  • Fix for correctly bubbling up errors in EvaluationDetails result.
go-sdk - v7.10.0

Published by z4kn4fein over 1 year ago

  • #58 Consolidate log messages across each SDK.
go-sdk - v7.9.0

Published by z4kn4fein over 1 year ago

  • 2023-04 package security update.
go-sdk - v7.8.3

Published by z4kn4fein over 1 year ago

  • Revert cache write restriction introduced in 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.
go-sdk - v7.8.2

Published by z4kn4fein over 1 year ago

  • Fix cache write behavior. It should be saved only when the new config's content differs from the previous.
go-sdk - v7.8.1

Published by z4kn4fein over 1 year ago

  • Fix reported version in X-ConfigCat-UserAgent header.
go-sdk - v7.8.0

Published by z4kn4fein almost 2 years ago

Added

  • SetOffline() / SetOnline() methods to extend the functionality of offline mode with switching between modes runtime.
go-sdk - v7.7.0

Published by z4kn4fein almost 2 years ago

Added

  • 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.

Changed

  • GetVariationID() / GetAllVariationIDs() methods became deprecated in favor of GetValueDetails() / GetAllValueDetails().
go-sdk - v7.6.0

Published by z4kn4fein over 2 years ago

  • Contents of #55 (Expose FetchTime() on Snapshot)
go-sdk - v7.5.1

Published by z4kn4fein over 2 years ago

  • Contents of #54
go-sdk - v7.5.0

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{}.