mirror of
https://github.com/grafana/grafana.git
synced 2024-11-28 03:34:15 -06:00
e5a6547a94
* Update thema to latest * Deal with s/Library/*Runtime/ * Commit new, working results of codegen
32 lines
748 B
Cheetah
32 lines
748 B
Cheetah
{{ template "autogen_header.tmpl" .Header -}}
|
|
package corelist
|
|
|
|
import (
|
|
"fmt"
|
|
"io/fs"
|
|
"sync"
|
|
"github.com/grafana/grafana"
|
|
"github.com/grafana/grafana/pkg/plugins/pfs"
|
|
"github.com/grafana/thema"
|
|
)
|
|
|
|
func makeTreeOrPanic(path string, pkgname string, rt *thema.Runtime) *pfs.Tree {
|
|
sub, err := fs.Sub(grafana.CueSchemaFS, path)
|
|
if err != nil {
|
|
panic("could not create fs sub to " + path)
|
|
}
|
|
tree, err := pfs.ParsePluginFS(sub, rt)
|
|
if err != nil {
|
|
panic(fmt.Sprintf("error parsing plugin metadata for %s: %s", pkgname, err))
|
|
}
|
|
return tree
|
|
}
|
|
|
|
func coreTreeList(rt *thema.Runtime) pfs.TreeList{
|
|
return pfs.TreeList{
|
|
{{- range .Plugins }}
|
|
makeTreeOrPanic("{{ .Path }}", "{{ .PkgName }}", rt),
|
|
{{- end }}
|
|
}
|
|
}
|