FeatureFlippers.feature_flipper
feature_flipper
, go back to FeatureFlippers module for more information.
Defines a feature flipper.
The name
must end with ?
.
Examples
feature_flipper :foo?
feature_flipper :bar?, expires: ~D[2000-01-01]
feature_flipper :baz?, disabled: true
Options
feature_flipper/2
accepts the following options:
:expires
- a string inYYYY-MM-DD
format representing the date when it should expire or aDate
struct.FeatureFlippers
does not alter any feature flipper flag in execution when they expire; this works as informational indication to developers when the respective flag should be decommissioned. The functionexpired/0
will also show the expired flag names.:disabled
- a boolean indicating if the feature flipper should be forcefully disabled. This is defined in compile time, so if a feature flipper hasdisabled: true
, it means that no application configuration will be read; the developer should reenable it and recompile the code if they need to turn it on again. It can be used when new features are not prepared for production yet, therefore they should never have the capability to be turned on.:default
- if the feature flipper flag is not present in theApplication.get_env/3
, assume this boolean as default. If not set,false
is the default.