mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 22:53:13 +08:00
Kindsys: Replace DefForGen
with kindsys.Kind
(#62642)
* Kindsys: Replace DeclForGen with kindsys.Kind DeclForGen was always unnecessary - it just wasn't obvious on initial implementation, when we were focused on generating unique types for each core kind. This removes it, considerably simplifying interactions with kindsys - virtually everything now just relies on kindsys.Kind and its derived interfaces. * Removed unused jenny * Rename params in jennies
This commit is contained in:
@ -1,28 +0,0 @@
|
||||
package codegen
|
||||
|
||||
import (
|
||||
"github.com/grafana/codejen"
|
||||
"github.com/grafana/grafana/pkg/plugins/pfs"
|
||||
)
|
||||
|
||||
func PluginDocsJenny(inner codejen.OneToOne[*pfs.PluginDecl]) codejen.OneToOne[*pfs.PluginDecl] {
|
||||
return &docsJenny{
|
||||
inner: inner,
|
||||
}
|
||||
}
|
||||
|
||||
type docsJenny struct {
|
||||
inner codejen.OneToOne[*pfs.PluginDecl]
|
||||
}
|
||||
|
||||
func (j *docsJenny) JennyName() string {
|
||||
return "PluginDocsJenny"
|
||||
}
|
||||
|
||||
func (j *docsJenny) Generate(decl *pfs.PluginDecl) (*codejen.File, error) {
|
||||
if !decl.HasSchema() {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return j.inner.Generate(decl)
|
||||
}
|
Reference in New Issue
Block a user