mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Kindsys: Replace "Declaration" with "Definition" (#62515)
* s/Declaration/Definition/g * s/DeclForGen/DefForGen/g * Rename some local vars
This commit is contained in:
@@ -13,7 +13,7 @@ type PluginDecl struct {
|
||||
Imports []*ast.ImportSpec
|
||||
PluginPath string
|
||||
PluginMeta plugindef.PluginDef
|
||||
KindDecl kindsys.Decl[kindsys.ComposableProperties]
|
||||
KindDecl kindsys.Def[kindsys.ComposableProperties]
|
||||
}
|
||||
|
||||
func EmptyPluginDecl(path string, meta plugindef.PluginDef) *PluginDecl {
|
||||
|
||||
@@ -61,7 +61,7 @@ func (psr *declParser) Parse(root fs.FS) ([]*PluginDecl, error) {
|
||||
Imports: pp.CUEImports,
|
||||
PluginMeta: pp.Properties,
|
||||
PluginPath: path,
|
||||
KindDecl: kind.Decl(),
|
||||
KindDecl: kind.Def(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ func ParsePluginFS(fsys fs.FS, rt *thema.Runtime) (ParsedPlugin, error) {
|
||||
return ParsedPlugin{}, err
|
||||
}
|
||||
|
||||
compo, err := kindsys.BindComposable(rt, kindsys.Decl[kindsys.ComposableProperties]{
|
||||
compo, err := kindsys.BindComposable(rt, kindsys.Def[kindsys.ComposableProperties]{
|
||||
Properties: props,
|
||||
V: iv,
|
||||
})
|
||||
|
||||
@@ -36,13 +36,13 @@ type ParsedPlugin struct {
|
||||
// ComposableKinds represents all the possible composable kinds that may be
|
||||
// defined in a Grafana plugin.
|
||||
//
|
||||
// The value of each field, if non-nil, is a standard [kindsys.Decl]
|
||||
// The value of each field, if non-nil, is a standard [kindsys.Def]
|
||||
// representing a CUE definition of a composable kind that implements the
|
||||
// schema interface corresponding to the field's name. (This invariant is
|
||||
// only enforced in [ComposableKinds] returned from [ParsePluginFS].)
|
||||
//
|
||||
// type ComposableKinds struct {
|
||||
// PanelCfg kindsys.Decl[kindsys.ComposableProperties]
|
||||
// Queries kindsys.Decl[kindsys.ComposableProperties]
|
||||
// DSCfg kindsys.Decl[kindsys.ComposableProperties]
|
||||
// PanelCfg kindsys.Def[kindsys.ComposableProperties]
|
||||
// Queries kindsys.Def[kindsys.ComposableProperties]
|
||||
// DSCfg kindsys.Def[kindsys.ComposableProperties]
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user