mirror of https://github.com/grafana/grafana
parent
86e466009a
commit
ce808e35f8
@ -0,0 +1,39 @@ |
|||||||
|
package checkregistry |
||||||
|
|
||||||
|
import ( |
||||||
|
"github.com/grafana/grafana/apps/advisor/pkg/app/checks" |
||||||
|
"github.com/grafana/grafana/apps/advisor/pkg/app/checks/datasourcecheck" |
||||||
|
"github.com/grafana/grafana/pkg/plugins" |
||||||
|
"github.com/grafana/grafana/pkg/registry/apis/datasource" |
||||||
|
"github.com/grafana/grafana/pkg/services/datasources" |
||||||
|
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore" |
||||||
|
) |
||||||
|
|
||||||
|
type Service struct { |
||||||
|
datasourceSvc datasources.DataSourceService |
||||||
|
pluginStore pluginstore.Store |
||||||
|
pluginContextProvider datasource.PluginContextWrapper |
||||||
|
pluginClient plugins.Client |
||||||
|
} |
||||||
|
|
||||||
|
func ProvideService(datasourceSvc datasources.DataSourceService, pluginStore pluginstore.Store, |
||||||
|
pluginContextProvider datasource.PluginContextWrapper, pluginClient plugins.Client) *Service { |
||||||
|
return &Service{ |
||||||
|
datasourceSvc: datasourceSvc, |
||||||
|
pluginStore: pluginStore, |
||||||
|
pluginContextProvider: pluginContextProvider, |
||||||
|
pluginClient: pluginClient, |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
func (s *Service) Checks() []checks.Check { |
||||||
|
return []checks.Check{ |
||||||
|
datasourcecheck.New( |
||||||
|
s.datasourceSvc, |
||||||
|
s.pluginStore, |
||||||
|
s.pluginContextProvider, |
||||||
|
s.pluginClient, |
||||||
|
), |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -1,13 +0,0 @@ |
|||||||
package checks |
|
||||||
|
|
||||||
var factories = []Factory{} |
|
||||||
|
|
||||||
// AddFactory adds a check factory to the list.
|
|
||||||
func AddFactory(r Factory) { |
|
||||||
factories = append(factories, r) |
|
||||||
} |
|
||||||
|
|
||||||
// GetFactories returns the list of check factories.
|
|
||||||
func GetFactories() []Factory { |
|
||||||
return factories |
|
||||||
} |
|
@ -1,16 +0,0 @@ |
|||||||
package checks |
|
||||||
|
|
||||||
import ( |
|
||||||
"github.com/grafana/grafana/pkg/plugins" |
|
||||||
"github.com/grafana/grafana/pkg/registry/apis/datasource" |
|
||||||
"github.com/grafana/grafana/pkg/services/datasources" |
|
||||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore" |
|
||||||
) |
|
||||||
|
|
||||||
// AdvisorConfig contains the list of wire services checks are allowed to use.
|
|
||||||
type AdvisorConfig struct { |
|
||||||
DatasourceSvc datasources.DataSourceService |
|
||||||
PluginStore pluginstore.Store |
|
||||||
PluginContextProvider datasource.PluginContextWrapper |
|
||||||
PluginClient plugins.Client |
|
||||||
} |
|
Loading…
Reference in new issue