FeatureFlags: Add helper to check against a set of flags (#97240)

This commit is contained in:
Ryan McKinley
2024-12-02 21:41:41 +02:00
committed by GitHub
parent 3448384e0d
commit 20a27da636
8 changed files with 36 additions and 13 deletions
+9
View File
@@ -23,6 +23,15 @@ type FeatureToggles interface {
GetEnabled(ctx context.Context) map[string]bool
}
func AnyEnabled(f FeatureToggles, flags ...string) bool {
for _, flag := range flags {
if f.IsEnabledGlobally(flag) {
return true
}
}
return false
}
// FeatureFlagStage indicates the quality level
type FeatureFlagStage int