Documentation ¶
Overview ¶
The fflag package implements a basic singleton pattern for the purpose of providing SPIRE with a system-wide feature flagging facility. Feature flags can be easily added here, in a single central location, and be consumed throughout the codebase.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
Load initializes the fflag package and configures its feature flag state based on the configuration input. Feature flags are designed to be Write-Once-Read-Many, and as such, Load can be called only once (except when Using Unload function for test scenarios, which will reset states enabling Load to be called again). Load will return an error if it is called more than once, if the configuration input cannot be parsed, or if an unrecognized flag is set.
Types ¶
type Flag ¶
type Flag string
Flag represents a feature flag and its configuration name
const ( // FlagForcedRotation controls whether or not the new APIs and // extensions related to forced rotation and revocation are // enabled or not. See #1934 for more information. FlagForcedRotation Flag = "forced_rotation" // FlagTestFlag is defined purely for testing purposes. FlagTestFlag Flag = "i_am_a_test_flag" )
To add a feature flag, decleare it here along with its config name. Then, add it to the `flags` package-level singleton map below, setting the appropriate default value. Flags should always be opt-in and default to false, with the only exception being flags that are in the process of being deprecated.