-
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
17 changed files
with
58 additions
and
182 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
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 |
---|---|---|
@@ -1,25 +1,13 @@ | ||
using System; | ||
using System.Reflection; | ||
|
||
namespace Appconfi.Web | ||
{ | ||
public class AppconfiOptions | ||
{ | ||
public AppconfiCacheConfiguration FeatureToggleCacheConfiguration { get; private set; } | ||
public string BaseAddress { get; set; } | ||
public string Application { get; set; } | ||
public string Key { get; set; } | ||
public string Environment { get; set; } = "[default]"; | ||
public TimeSpan CacheExpirationTime { get; set; } = TimeSpan.FromMinutes(5); | ||
|
||
public AppconfiOptions UseFeatureToggleCache(Assembly assembly, string resourceFileName) | ||
{ | ||
FeatureToggleCacheConfiguration = new AppconfiCacheConfiguration | ||
{ | ||
Assembly = assembly, | ||
EmbeddedFilePath = resourceFileName | ||
}; | ||
return this; | ||
} | ||
} | ||
} |
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,16 +1,21 @@ | ||
namespace Appconfi.Web | ||
{ | ||
public class FeatureManager : IFeatureManager | ||
public class FeatureManager : IAppconfiFeatureManager | ||
{ | ||
private readonly AppconfiManager manager; | ||
|
||
public FeatureManager(AppconfiManager manager) | ||
{ | ||
this.manager = manager; | ||
} | ||
public bool IsEnabled(string featureName) | ||
public bool IsEnabled(string featureName, bool defaultValue = false) | ||
{ | ||
return manager.IsFeatureEnabled(featureName); | ||
return manager.IsFeatureEnabled(featureName, defaultValue); | ||
} | ||
|
||
public void ForceRefresh() | ||
{ | ||
manager.ForceRefresh(); | ||
} | ||
} | ||
} |
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,8 @@ | ||
namespace Appconfi.Web | ||
{ | ||
public interface IAppconfiFeatureManager | ||
{ | ||
void ForceRefresh(); | ||
bool IsEnabled(string featureName, bool defaultValue = false); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.