Repository navigation
Closed
Labels
Needs TriageThis issue needs to be investigated by a maintainerdocumentationImprovements or additions to documentation
Description
Change in the documentation
Overview
Flag configurations are powerful but may be intimidating for new users. A list of some sample configurations (or recipes) ordered from basic to complex that show realistic use cases would help provide a solid understand of what's possible.
Examples
The following examples can be used as a starting point for how the doc may be structured.
Basic
A boolean flag that's enabled for everyone
{
"flags": {
"myBoolFlag": {
"state": "ENABLED",
"variants": {
"true": true,
"false": false
},
"defaultVariant": "true"
}
}Intermediate
A boolean flag that's enabled only for specific companies.
{
"flags": {
"myBoolFlag": {
"state": "ENABLED",
"variants": {
"true": true,
"false": false
},
"defaultVariant": "false",
"targeting": {
"in": [ { "var": "company" }, ["Hooli", "Acme", "Initech"]]
}
}
}NOTE: This targeting rule will returns a boolean, which happens to match a variant name.
Advanced
Sudo randomly return a color based on the browser
{
"flags": {
"headerColor": {
"variants": {
"red": "#FF0000",
"blue": "#0000FF",
"green": "#00FF00"
},
"defaultVariant": "red",
"state": "ENABLED",
"targeting": {
"fractionalEvaluation": [
"browser",
[
"red",
50
],
[
"blue",
20
],
[
"green",
30
]
]
}
}
}
}NOTE: See fraction evaluation for more information.
Metadata
Metadata
Assignees
Labels
Needs TriageThis issue needs to be investigated by a maintainerdocumentationImprovements or additions to documentation
Activity
fix(deps): update module github.com/thomaspoignant/go-feature-flag to…
chore: resolve open dependabot security alerts