🆕 Create Flags
Overview
In GO Feature Flag a flag is a configuration that allows you to serve a variation based on some conditions.
Since day 1, we have decided that we won't be the one telling you were to store your feature flags, and this is why we have introduce the concept of retriever. To support this concept we had to define a simple way to define your feature flags.
In GO Feature Flag you can store your flags in a file, and we support YAML
, JSON
and TOML
format.
A mechanism that allows an Application Author to define alternative codepaths within a deployed piece of software, which is conditionally executed at runtime, based on a rule set.
Editor
Creating the first version of the flag is not always pleasant, that's why we have created GO Feature Flag Editor a simple editor to create your files.
✏️ Create your first feature flag manually
-
When starting to use GO Feature Flag, the first step will be to create the flag that will store your feature flags. This file should be a
YAML
,JSON
orTOML
file.✏️ In this file you can start creating your feature flags.
-
First, find a name for your feature flag (this will be the key of your flag and it must be unique).
-
Define the variations that your flag can return.
flag-config.goff.yamldisplay-banner:
variations:
enabled: true
disabled: false
# ... -
Define a default rule, that will be serve when no targeting match.
flag-config.goff.yamldisplay-banner:
variations:
enabled: true
disabled: false
defaultRule:
variation: disabled -
🎉 Congrats you have your first feature flag created. This flag will return the variation
disabled
and the valuefalse
for all the users, but you can start targeting a specific group of users to return the variantenabled
. -
Now you can store your flag file in your favorite storage and start using it in your application.