FeatureFlags: Use interface rather than manager (#80000)
This commit is contained in:
@@ -574,26 +574,3 @@ func (p *FakeBackendPlugin) Kill() {
|
||||
defer p.mutex.Unlock()
|
||||
p.Running = false
|
||||
}
|
||||
|
||||
type FakeFeatureToggles struct {
|
||||
features map[string]bool
|
||||
}
|
||||
|
||||
func NewFakeFeatureToggles(features ...string) *FakeFeatureToggles {
|
||||
m := make(map[string]bool)
|
||||
for _, f := range features {
|
||||
m[f] = true
|
||||
}
|
||||
|
||||
return &FakeFeatureToggles{
|
||||
features: m,
|
||||
}
|
||||
}
|
||||
|
||||
func (f *FakeFeatureToggles) GetEnabled(_ context.Context) map[string]bool {
|
||||
return f.features
|
||||
}
|
||||
|
||||
func (f *FakeFeatureToggles) IsEnabledGlobally(feature string) bool {
|
||||
return f.features[feature]
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@ var (
|
||||
type Local struct {
|
||||
log log.Logger
|
||||
production bool
|
||||
features plugins.FeatureToggles
|
||||
features featuremgmt.FeatureToggles
|
||||
}
|
||||
|
||||
func NewLocalFinder(devMode bool, features plugins.FeatureToggles) *Local {
|
||||
func NewLocalFinder(devMode bool, features featuremgmt.FeatureToggles) *Local {
|
||||
return &Local{
|
||||
production: !devMode,
|
||||
log: log.New("local.finder"),
|
||||
|
||||
Reference in New Issue
Block a user