* Remove kinds verification for kind-registry * Read plugin's json information with json library instead of use thema binding * Remove grafanaplugin unification * Don't use kindsys for extract the slot name * Fix IsGroup * Remove all plugindef generation * Refactor schema interfaces * Pushed this change from a different branch by mistake... * Create small plugin definition structure adding additional information for plugins registration * Add some validation checks * Delete unused code * Fix imports lint
41 lines
775 B
Go
41 lines
775 B
Go
package pfs
|
|
|
|
import (
|
|
"cuelang.org/go/cue/ast"
|
|
"github.com/grafana/kindsys"
|
|
"github.com/grafana/thema"
|
|
)
|
|
|
|
type PluginDecl struct {
|
|
SchemaInterface *SchemaInterface
|
|
Lineage thema.Lineage
|
|
Imports []*ast.ImportSpec
|
|
PluginPath string
|
|
PluginMeta Metadata
|
|
KindDecl kindsys.Def[kindsys.ComposableProperties]
|
|
}
|
|
|
|
type SchemaInterface struct {
|
|
Name string
|
|
IsGroup bool
|
|
}
|
|
|
|
type Metadata struct {
|
|
Id string
|
|
Name string
|
|
Backend *bool
|
|
Version *string
|
|
}
|
|
|
|
func EmptyPluginDecl(path string, meta Metadata) *PluginDecl {
|
|
return &PluginDecl{
|
|
PluginPath: path,
|
|
PluginMeta: meta,
|
|
Imports: make([]*ast.ImportSpec, 0),
|
|
}
|
|
}
|
|
|
|
func (decl *PluginDecl) HasSchema() bool {
|
|
return decl.Lineage != nil && decl.SchemaInterface != nil
|
|
}
|