mirror of
https://github.com/grafana/grafana.git
synced 2026-08-18 17:15:08 -05:00
Expressions: Add option to disable feature (#30541)
* Expressions: Add option to disable feature * Apply suggestions from code review Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
This commit is contained in:
co-authored by
achatterjee-grafana
parent
5d52e50f6f
commit
9ada4b6052
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
// DatasourceName is the string constant used as the datasource name in requests
|
||||
@@ -20,6 +21,14 @@ const DatasourceUID = "-100"
|
||||
|
||||
// Service is service representation for expression handling.
|
||||
type Service struct {
|
||||
Cfg *setting.Cfg
|
||||
}
|
||||
|
||||
func (s *Service) isDisabled() bool {
|
||||
if s.Cfg == nil {
|
||||
return true
|
||||
}
|
||||
return !s.Cfg.ExpressionsEnabled
|
||||
}
|
||||
|
||||
// BuildPipeline builds a pipeline from a request.
|
||||
|
||||
Reference in New Issue
Block a user