From db415d6c70e001efea697b748aa9faaf736bf75a Mon Sep 17 00:00:00 2001 From: cubixle Date: Wed, 16 Jun 2021 21:52:50 +0100 Subject: [PATCH] started work on the data models --- cmd/tuugen/main.go | 1 - .../{data_obj.go.tmpl => data_model.go.tmpl} | 0 db.go | 11 +++++++++++ protos.go | 1 - 4 files changed, 11 insertions(+), 2 deletions(-) rename cmd/tuugen/templates/{data_obj.go.tmpl => data_model.go.tmpl} (100%) delete mode 100644 protos.go diff --git a/cmd/tuugen/main.go b/cmd/tuugen/main.go index d523711..280c19e 100644 --- a/cmd/tuugen/main.go +++ b/cmd/tuugen/main.go @@ -2,7 +2,6 @@ package main import ( "embed" - _ "embed" "io/ioutil" "log" diff --git a/cmd/tuugen/templates/data_obj.go.tmpl b/cmd/tuugen/templates/data_model.go.tmpl similarity index 100% rename from cmd/tuugen/templates/data_obj.go.tmpl rename to cmd/tuugen/templates/data_model.go.tmpl diff --git a/db.go b/db.go index 5f0ff7c..95bc30e 100644 --- a/db.go +++ b/db.go @@ -10,3 +10,14 @@ type DataProperty struct { Type string `yaml:"type"` AutoIncrement bool `yaml:"autoinc"` } + +func GenerateDataModels(cfg Config) error { + t, err := template.ParseFS(FS, "templates/data_model.go.tmpl") + if err != nil { + return err + } + + outputFile := "internal/data/models.go" + // check/create file path + fp := filepath.Dir(outputFile) +} \ No newline at end of file diff --git a/protos.go b/protos.go deleted file mode 100644 index fda308e..0000000 --- a/protos.go +++ /dev/null @@ -1 +0,0 @@ -package tuugen