use the tuugen.yml file

This commit is contained in:
cubixle
2021-06-16 19:07:54 +01:00
parent 8f67f0703e
commit 56d9a561ef
8 changed files with 76 additions and 24 deletions
+17
View File
@@ -0,0 +1,17 @@
package tuugen
import "gopkg.in/yaml.v2"
type Config struct {
Project string `yaml:"project"`
ServiceName string `yaml:"service_name"`
ImportPath string `yaml:"import_path"`
ProtoFile string `yaml:"proto_file"`
DataModels []DataModel `yaml:"data_models"`
}
func YamlToConfig(b []byte) (Config, error) {
cfg := Config{}
err := yaml.Unmarshal(b, &cfg)
return cfg, err
}