mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Introduce coremodels framework (extracted from intent-api) (#47653)
* Copy over most of coremodel from intent-api branch * Fix import paths * Fix incorrect provider name * Add root compgen file, fixup componentroot.yaml * go mod tidy * Remove compgen for now * Add dashboard coremodel * Remove datasource coremodel, for now * Tweak comments on dashboard struct model * devenv: add dashboard testing directly * Fixup dashboard schema for openness, heatmap * Update Thema to tip * Fix wire/registry references * Fix hclog version
This commit is contained in:
17
pkg/framework/coremodel/staticregistry/provide.go
Normal file
17
pkg/framework/coremodel/staticregistry/provide.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package staticregistry
|
||||
|
||||
import (
|
||||
"github.com/grafana/grafana/pkg/coremodel/dashboard"
|
||||
"github.com/grafana/grafana/pkg/framework/coremodel"
|
||||
)
|
||||
|
||||
// ProvideRegistry provides a simple static Registry for coremodels.
|
||||
// Coremodels have to be manually added.
|
||||
// TODO dynamism
|
||||
func ProvideRegistry(
|
||||
dashboard *dashboard.Coremodel,
|
||||
) (*coremodel.Registry, error) {
|
||||
return coremodel.NewRegistry(
|
||||
dashboard,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user