github.com/wtfutil/wtf@v0.43.0/generator/settings.tpl (about) 1 package {{(Lower .Name)}} 2 3 import ( 4 "github.com/olebedev/config" 5 "github.com/wtfutil/wtf/cfg" 6 ) 7 8 const ( 9 defaultFocusable = false 10 defaultTitle = "{{(.Name)}}" 11 ) 12 13 // Settings defines the configuration properties for this module 14 type Settings struct { 15 common *cfg.Common 16 17 // Define your settings attributes here 18 } 19 20 // NewSettingsFromYAML creates a new settings instance from a YAML config block 21 func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings { 22 settings := Settings{ 23 common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig), 24 25 // Configure your settings attributes here. See http://github.com/olebedev/config for type details 26 } 27 28 return &settings 29 }