config_utils

package
v0.25.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFeatureFlagToConfig

func AddFeatureFlagToConfig(engine workflow.Engine, configKey string, featureFlagName string)

func AddFeatureFlagsToConfig

func AddFeatureFlagsToConfig(
	engine workflow.Engine,
	configKeyToFlag map[string]string,
)

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

func IsExperimental(flags *pflag.FlagSet) bool

IsExperimental checks if the flagset requires the experimental flag

func MarkAsExperimental

func MarkAsExperimental(flags *pflag.FlagSet) *pflag.FlagSet

MarkAsExperimental ensures that the flagset requires the experimental flag

func MarkAsUsedToBeExperimental

func MarkAsUsedToBeExperimental(flags *pflag.FlagSet) *pflag.FlagSet

MarkAsUsedToBeExperimental ensures that the flagset accepts the experimental flag but marks it as deprecated

Types

type SanityCheckResult

type SanityCheckResult struct {
	Description string
}

func CheckSanity

func CheckSanity(config configuration.Configuration) []SanityCheckResult

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL