ConfigCat.OverrideDataSource protocol (ConfigCat v2.0.0) View Source

Data source for local overrides of feature flags and settings.

With flag overrides you can overwrite the feature flags & settings downloaded from the ConfigCat CDN with local values. Moreover, you can specify how the overrides should apply over the downloaded values. See behaviour/0.

Link to this section Summary

Types

Flag override behaviour.

t()

Functions

Return the selected flag override behaviour.

Return the local flag overrides from the data source.

Link to this section Types

Specs

behaviour() :: :local_only | :local_over_remote | :remote_over_local

Flag override behaviour.

The following 3 behaviours are supported:

  • Local/Offline mode (:local_only): When evaluating values, the SDK will not use feature flags & settings from the ConfigCat CDN, but it will use all feature flags & settings that are loaded from local-override sources.

  • Local over remote (:local_over_remote): When evaluating values, the SDK will use all feature flags & settings that are downloaded from the ConfigCat CDN, plus all feature flags & settings that are loaded from local-override sources. If a feature flag or a setting is defined both in the downloaded and the local-override source then the local-override version will take precedence.

  • Remote over local (:remote_over_local): When evaluating values, the SDK will use all feature flags & settings that are downloaded from the ConfigCat CDN, plus all feature flags & settings that are loaded from local-override sources. If a feature flag or a setting is defined both in the downloaded and the local-override source then the downloaded version will take precedence.

Specs

t() :: term()

Link to this section Functions

Specs

behaviour(data_source :: t()) :: behaviour()

Return the selected flag override behaviour.

Specs

overrides(data_source :: t()) :: {:ok, ConfigCat.Config.t()} | {:error, term()}

Return the local flag overrides from the data source.