Update generator interface and plugins

This commit is contained in:
David Allen 2024-06-26 13:41:14 -06:00
parent 30c8336ca6
commit e92a883c89
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC
9 changed files with 85 additions and 5 deletions

View file

@ -15,6 +15,14 @@ func (g *DnsMasq) GetName() string {
return "dnsmasq"
}
func (g *DnsMasq) GetVersion() string {
return util.GitCommit()
}
func (g *DnsMasq) GetDescription() string {
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
}
func (g *DnsMasq) Generate(config *configurator.Config, opts ...util.Option) (map[string][]byte, error) {
// make sure we have a valid config first
if config == nil {
@ -50,7 +58,7 @@ func (g *DnsMasq) Generate(config *configurator.Config, opts ...util.Option) (ma
// print message if verbose param found
if verbose, ok := params["verbose"].(bool); ok {
if verbose {
fmt.Printf("template: \n%s\n ethernet interfaces found: %v\n", strings.Join(target.Templates, "\n\t"), len(eths))
fmt.Printf("template: \n%s\nethernet interfaces found: %v\n", strings.Join(target.Templates, "\n\t"), len(eths))
}
}