weaver
weaver copied to clipboard
feat: adding a Global Config Default Configuration
In the process of using Weaver, I found that I could not set the default value of Config. This makes it impossible to use the correct settings when you have not configured config.toml. We hope to add a setting for the default Config value at startup.
type Main struct {
weaver.Implements[weaver.Main]
weaver.WithConfig[config.Config]
}
func (m *Main) Init(ctx context.Context) error {
// config only can loads from toml?
// fmt.Println("config:", m.Config())
return nil
}