-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
64 additions
and
26 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
6 changes: 3 additions & 3 deletions
6
examples/FeatureFlagger.Example.Console/ExampleFeatureFlag.cs
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,38 @@ | ||
namespace FeatureFlagger.ConfigurationReaders | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Composition; | ||
using System.Linq; | ||
using FeatureFlagger.Domain; | ||
|
||
[Export(typeof(IConfigurationReader))] | ||
[ExportMetadata("Reader", "TEST")] | ||
public class TestReader : IConfigurationReader | ||
{ | ||
public Feature Read(string featureName, IEnumerable<Feature> features) | ||
{ | ||
return | ||
features.ToList() | ||
.Find( | ||
f => | ||
f.Name.Equals( | ||
featureName, | ||
StringComparison.OrdinalIgnoreCase)); | ||
} | ||
|
||
public IEnumerable<Feature> ReadAll() | ||
{ | ||
List<Feature> features = new List<Feature>(); | ||
|
||
var properties = | ||
new Dictionary<string, string> { { "enabled", "true" } }; | ||
var flag = new Flag("Enabled", properties); | ||
var feature = new Feature("example", new List<Flag> { flag }); | ||
|
||
features.Add(feature); | ||
|
||
return features; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,18 1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<configSections> | ||
<section name="features" type="FeatureFlagger.ConfigurationReaders.FeaturesSection, FeatureFlagger.ConfigurationReaders" /> | ||
</configSections> | ||
<features> | ||
<feature name="example" enabled="true"></feature> | ||
<feature name="disabled" enabled="false"></feature> | ||
<feature name="from" enabled="true"> | ||
<from date="2015-03-20" /> | ||
</feature> | ||
<feature name="test" enabled="true"> | ||
<from date="2015-03-20" /> | ||
<rollout percentage="25" basis="user" name="barndoor" /> | ||
<fullmoon /> | ||
</feature> | ||
</features> | ||
<appSettings> | ||
<add key="FeatureFlagger.Reader" value="TEST"/> | ||
</appSettings> | ||
</configuration> |
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