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 - v7.4.2

Published by z4kn4fein over 2 years ago

  • fix panic when a key isn't found #51
go-sdk - v7.4.1

Published by z4kn4fein over 2 years ago

  • Readded the missing polling identifier to the X-ConfigCat-UserAgent header.
go-sdk - v7.4.0

Published by z4kn4fein over 2 years ago

  • add Config.DefaultUser #49
  • configcattest: add variation IDs #50
go-sdk - v7.3.0

Published by z4kn4fein over 2 years ago

  • Contents of the PRs #44, #45, #46, #47, #48

Thanks to @rogpeppe for the contribution!

go-sdk - v7.2.0

Published by z4kn4fein almost 3 years ago

  • A .Key() accessor was added to each flag type. #43

Thanks to @rogpeppe for the contribution!

go-sdk - v7.1.0

Published by z4kn4fein almost 3 years ago

  • Ability to create Snapshot from already known values. #41
  • Tests for log entries. #42

Special thanks to @rogpeppe for the improvements.

go-sdk - v7.0.0

Published by z4kn4fein over 3 years ago

Breaking changes:

Here is the list of breaking API changes compared to v6:

Configuration:

  • When using the configcat.NewCustomClient(config) function, the SDKKey is moved to the config 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 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 with nil as the User 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 a context.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 additional context.Context parameter.
  • The way of the User object creation changed:
    • Old: user := configcat.NewUser("<USER-IDENTIFIER>")
    • New: user := &configcat.UserData{Identifier: "<USER-IDENTIFIER>"}

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!

go-sdk - v6.1.1

Published by z4kn4fein almost 4 years ago

Revert to Contains semantics when isOneOf or isNotOneOf comparators are used to evaluate a user attribute.

go-sdk - v6.1.0

Published by z4kn4fein almost 4 years ago

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.

go-sdk - v6.0.2

Published by z4kn4fein almost 4 years ago

  • Code improvements added in #11 and #12
go-sdk - v6.0.1

Published by z4kn4fein almost 4 years ago

  • Code improvements added in #10
go-sdk - v6.0.0

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:

  • Custom cache implementations should implement the new cache interface using key parameter in the get/set methods.
go-sdk - v5.1.0

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]()
go-sdk - v5.0.0

Published by configcat over 4 years ago

Breaking change: Renamed API Key to SDK Key.

go-sdk - v4.0.4

Published by configcat over 4 years ago

Add option to set the log severity of the default logger

go-sdk -

Published by z4kn4fein over 4 years ago

go-sdk - ConfigCat Go SDK v1.2

Published by configcat over 4 years ago

go-sdk - ConfigCat Go SDK v1.4

Published by configcat over 4 years ago

go-sdk - ConfigCat Go SDK v2.0

Published by configcat over 4 years ago

go-sdk - ConfigCat Go SDK v2.1

Published by configcat over 4 years ago