mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Settings: Add a method to Provider interface to check if a feature is enabled (#41250)
* Settings: Add method to Provider interface to get feature toggles * Apply review comment
This commit is contained in:
parent
1c3c1a52bb
commit
da39c6ce55
@ -49,6 +49,8 @@ type Provider interface {
|
||||
// RegisterReloadHandler registers a handler for validation and reload
|
||||
// of configuration updates tied to a specific section
|
||||
RegisterReloadHandler(section string, handler ReloadHandler)
|
||||
// IsFeatureToggleEnabled checks if the feature's toggle is enabled
|
||||
IsFeatureToggleEnabled(name string) bool
|
||||
}
|
||||
|
||||
// Section is a settings section copy
|
||||
@ -129,6 +131,10 @@ func (o *OSSImpl) Section(section string) Section {
|
||||
|
||||
func (OSSImpl) RegisterReloadHandler(string, ReloadHandler) {}
|
||||
|
||||
func (o OSSImpl) IsFeatureToggleEnabled(name string) bool {
|
||||
return o.Cfg.FeatureToggles[name]
|
||||
}
|
||||
|
||||
type keyValImpl struct {
|
||||
key *ini.Key
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user