Documentation ¶
Overview ¶
The featureflags module exists to control optional functionality
The main purpose is to hide functionality that is still in development, that isn't yet fully featured enough to be GA, or that isn't relevant to all users.
The format is key-value, both strings, for rare situations where new values need to be introduced to the same flag. You should usually treat the value as a boolean - create one flag per alternative, don't create complicated sets of values. E.g. set FOO_BAR_ENABLED and FOO_BAR_IN_MAIN_MENU as separate flags, not FOO_BAR="enabled" or "FOO_BAR="in_main_menu", as the latter format is more likely to be confused. At the same time, you should check for exact value when checking the flag, to avoid misinterpreting it in the future.
All flags that are set here on the backend will also be set in the featureflags endpoint on the frontend.
Index ¶
Constants ¶
const (
FeatureFlagSet string = "true"
)
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns the value of a flag, or "" if the flag wasn't set You should use the same behaviour for "flag not set" as you would for "flag set to unknown value", so always check for the exact value.
func GetFlags ¶
GetFlags returns all featureflags This is only intended to be used by the API to return the flags to the frontend - for all other uses, use `Get`
func Set ¶
func Set(key, value string)
Set sets one specific featureflag Existing flags will be overwritten.
func SetBoolean ¶ added in v0.31.0
SetBoolean sets the named feature flag to the boolean flag state. If set to true, IsSet will return true for the same name.
func SetFromEnv ¶ added in v0.9.4
func SetFromEnv(envVars []string)
SetFromEnv sets the feature flags from the environment variables
Types ¶
This section is empty.