-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlagfile.example
78 lines (61 loc) · 1.89 KB
/
Flagfile.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// once you dont have rules you can use short notation to return boolean
FF-feature-flat-on-off -> true
// you can return non-boolean in this example json. or empty json object json({})
FF-feature-json-variant -> json({"success": true})
// features are forced to start with FF- case-sensitive as
// it allows you later to find all flags through in codebase
FF-feature-name-specifics -> false
// can be snake_case as well as kebab-case
FF_feature_can_be_snake_case_213213 -> FALSE
// can be camelCase
FF_featureOneOrTwo -> FALSE
// can be PascalCase
FF_Feature23432 -> TRUE
// you can have feature with multiple rules in it with default flag value returned in end
FF-feature-y {
// if country is NL return True
countryCode == NL -> true
// else default to false
false
}
// you can also return different variations (non-boolean) as example json
FF-testing {
// default variant
json({"success": true})
}
// and have more complex feature with multiple rules in it, which at the end defaults to false
FF-feature-complex-ticket-234234 {
// complex bool expression
a = b and c=d and (dd not in (1,2,3) or z == "demo car") -> TRUE
// another one
z == "demo car" -> FALSE
// with checking more
g in (4,5,6) and z == "demo car" -> json({"success": true})
// and multi-line rule works
model in (ms,mx,m3,my) and created >= 2024-01-01
and demo == false -> TRUE
FALSE
}
// different kind of comments inside
FF-feature1 {
/* comment like this */
true
a == "something" -> false
false
json({})
}
// @author Nikolajus K
// @expires 2024-12-31 00:00:00
FF-flag-with-annotations -> true
/**
* @author Nikolajus K
* @expires 2024-12-31 00:00:00
*/
FF-flag-with-annotations-2 -> false
/* this is multi-line commented feature
FF-timer-feature {
// turn on only on evaluation time after 22nd feb
NOW() > 2024-02-22 -> true
false
}
*/