-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Suraj Banakar <surajrbanakar@gmail.com> feat: wip try replacing json evaluator with a generic file type evaluator - TODO: - still need a way to make the json_evaluator_model more composable - replace instances of `json` with the `MUaler` interface - implement `MUaler` interface for yaml and json Signed-off-by: Suraj Banakar <surajrbanakar@gmail.com> feat: wip pass `yaml` as filetype to `FilePathSync` - check `yaml.Unmarshal` not able to `Unmarshal` to `json.rawMessage` which is just `[]byte` with `MarshalJSON` and `UnmarshalJSON` - `FileTypeEvaluator` didn't turn out to be such a good idea because we are reliant on `gojsonschema` to test json schema - add `example_flags.yaml` file based on `examples_flags.json` refactor: remove traces of `FileTypeEvaluator` Signed-off-by: Suraj Banakar <surajrbanakar@gmail.com> feat: wip try yaml->map->json conversion - the code compiles and the converted json seems to look good but flagd throws error - need to look into this ^ Signed-off-by: Suraj Banakar <surajrbanakar@gmail.com> feat: wip remove yaml annotationt and redundant code - yaml config -> json config -> json.Unmarshal (<- error here) Signed-off-by: Suraj Banakar <surajrbanakar@gmail.com> feat: wip add indentations in the json converted from yaml - because the evaluator transposer function doesn't understand json without indentations well - needs more testing Signed-off-by: Suraj Banakar <surajrbanakar@gmail.com> feat: refactor Signed-off-by: Suraj Banakar <surajrbanakar@gmail.com> feat: add `yaml` and `yml` in evaluator switch case feat: fix go.mod - add json-iterator package Signed-off-by: Suraj Banakar <surajrbanakar@gmail.com>
- Loading branch information
1 parent
418b9ef
commit 07e75c5
Showing
5 changed files
with
136 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
flags: | ||
myBoolFlag: | ||
state: ENABLED | ||
variants: | ||
'on': true | ||
'off': false | ||
defaultVariant: 'on' | ||
myStringFlag: | ||
state: ENABLED | ||
variants: | ||
key1: val1 | ||
key2: val2 | ||
defaultVariant: key1 | ||
myFloatFlag: | ||
state: ENABLED | ||
variants: | ||
one: 1.23 | ||
two: 2.34 | ||
defaultVariant: one | ||
myIntFlag: | ||
state: ENABLED | ||
variants: | ||
one: 1 | ||
two: 2 | ||
defaultVariant: one | ||
myObjectFlag: | ||
state: ENABLED | ||
variants: | ||
object1: | ||
key: val | ||
object2: | ||
key: true | ||
defaultVariant: object1 | ||
isColorYellow: | ||
state: ENABLED | ||
variants: | ||
'on': true | ||
'off': false | ||
defaultVariant: 'off' | ||
targeting: | ||
if: | ||
- "==": | ||
- var: | ||
- color | ||
- yellow | ||
- 'on' | ||
- 'off' | ||
fibAlgo: | ||
variants: | ||
recursive: recursive | ||
memo: memo | ||
loop: loop | ||
binet: binet | ||
defaultVariant: recursive | ||
state: ENABLED | ||
targeting: | ||
if: | ||
- "$ref": emailWithFaas | ||
- binet | ||
- null | ||
headerColor: | ||
variants: | ||
red: "#FF0000" | ||
blue: "#0000FF" | ||
green: "#00FF00" | ||
yellow: "#FFFF00" | ||
defaultVariant: red | ||
state: ENABLED | ||
targeting: | ||
if: | ||
- "$ref": emailWithFaas | ||
- fractionalEvaluation: | ||
- - red | ||
- 25 | ||
- - blue | ||
- 25 | ||
- - green | ||
- 25 | ||
- - yellow | ||
- 25 | ||
- null | ||
"$evaluators": | ||
emailWithFaas: | ||
in: | ||
- "@faas.com" | ||
- var: | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters