BitzOrcas 为功能开关定义了 IFeatureStore 端口,但使用 UnavailableFeatureStore 作为默认——功能开关在当前版本中尚未实现。
当前状态
public interface IFeatureStore{ Task<bool> IsEnabledAsync(string featureName, string? tenantId = null, CancellationToken ct = default);}
// 默认:始终返回 false(特性禁用)public class UnavailableFeatureStore : IFeatureStore{ public Task<bool> IsEnabledAsync(string featureName, ...) => Task.FromResult(false);}计划实现
| 提供者 | 描述 |
|---|---|
| 基于配置 | appsettings.json 功能开关(最简单) |
| Azure App Configuration | 带定向的托管功能开关 |
| LaunchDarkly | 企业级特性管理 |
| 自定义 | 基于数据库,带管理 UI |
使用模式(未来)
if (await featureStore.IsEnabledAsync("new-dashboard", tenantId)){ // 提供新仪表盘}else{ // 提供旧版仪表盘}集成点
功能开关在 AddBitzOrcasPlatformApplication() 中注册——用真实实现替换默认的 UnavailableFeatureStore 将全局激活特性。