Documentation
¶
Index ¶
- func AddFeatureFlagToConfig(engine workflow.Engine, configKey string, featureFlagName string)
- func AddFeatureFlagsToConfig(engine workflow.Engine, configKeyToFlag map[string]string)
- func GetFeatureFlagValue(featureFlagName string, config configuration.Configuration, ...) (bool, error)
- func IsExperimental(flags *pflag.FlagSet) bool
- func MarkAsExperimental(flags *pflag.FlagSet) *pflag.FlagSet
- func MarkAsUsedToBeExperimental(flags *pflag.FlagSet) *pflag.FlagSet
- type SanityCheckResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFeatureFlagToConfig ¶
func AddFeatureFlagsToConfig ¶
AddFeatureFlagsToConfig registers configuration keys that are backed by remote feature flags. Flags are looked up lazily: the first access to any of them looks up every flag registered so far in a single request, and flags registered afterwards are picked up by the next access that needs them.
A key that already holds a value keeps it, and its flag is left out of the batch another key triggers, so it is not evaluated remotely for nothing. Two limits apply. The value has to be there before the first flag is resolved - an override applied later cannot unsend a request. And the batch is narrowed via Configuration.IsSet, which answers a slightly narrower question than the callback's own "does this key already have a value": it does not see a value that only a pflag default or a non-last alternative key provides. Such a key still keeps its value, its flag is merely evaluated needlessly.
Registration has to happen before a configuration is cloned. Clone copies the default value functions that exist at that moment, so a configuration cloned before a flag is registered resolves that flag to false.
func GetFeatureFlagValue ¶
func GetFeatureFlagValue(featureFlagName string, config configuration.Configuration, httpClient *http.Client) (bool, error)
func IsExperimental ¶
IsExperimental checks if the flagset requires the experimental flag
func MarkAsExperimental ¶
MarkAsExperimental ensures that the flagset requires the experimental flag
Types ¶
type SanityCheckResult ¶
type SanityCheckResult struct {
Description string
}
func CheckSanity ¶
func CheckSanity(config configuration.Configuration) []SanityCheckResult