refactor: more code cleanup and simplification
This commit is contained in:
parent
32065dc163
commit
a7b8fb0de5
11 changed files with 268 additions and 398 deletions
|
|
@ -1,13 +1,9 @@
|
|||
//go:build example || plugins
|
||||
// +build example plugins
|
||||
|
||||
package generator
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
configurator "github.com/OpenCHAMI/configurator/pkg"
|
||||
"github.com/OpenCHAMI/configurator/pkg/generator"
|
||||
"github.com/OpenCHAMI/configurator/pkg/config"
|
||||
"github.com/OpenCHAMI/configurator/pkg/util"
|
||||
)
|
||||
|
||||
|
|
@ -27,11 +23,9 @@ func (g *Example) GetDescription() string {
|
|||
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
||||
}
|
||||
|
||||
func (g *Example) Generate(config *configurator.Config, opts ...util.Option) (generator.FileMap, error) {
|
||||
func (g *Example) Generate(config *config.Config, params Params) (FileMap, error) {
|
||||
g.Message = `
|
||||
This is an example generator plugin. See the file in 'internal/generator/plugins/example/example.go' on
|
||||
information about constructing plugins and plugin requirements.`
|
||||
return generator.FileMap{"example": []byte(g.Message)}, nil
|
||||
return FileMap{"example": []byte(g.Message)}, nil
|
||||
}
|
||||
|
||||
var Generator Example
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue