tons of code
This commit is contained in:
parent
bfe8409c15
commit
3ef477922d
@ -9,8 +9,12 @@ import (
|
|||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
"efprojects.com/kitten-ipc/kitcom/api"
|
"efprojects.com/kitten-ipc/kitcom/api"
|
||||||
|
_ "embed"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//go:embed go_gen.tmpl
|
||||||
|
var templateString string
|
||||||
|
|
||||||
type goGenData struct {
|
type goGenData struct {
|
||||||
PkgName string
|
PkgName string
|
||||||
Api *api.Api
|
Api *api.Api
|
||||||
@ -54,11 +58,11 @@ func (g *GoApiGenerator) Generate(apis *api.Api, destFile string) error {
|
|||||||
return v, nil
|
return v, nil
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
tpl = template.Must(tpl.ParseFiles("./golang/go_gen.tmpl"))
|
tpl = template.Must(tpl.Parse(templateString))
|
||||||
|
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
|
|
||||||
if err := tpl.ExecuteTemplate(&buf, "go_gen.tmpl", tplCtx); err != nil {
|
if err := tpl.ExecuteTemplate(&buf, "gogen", tplCtx); err != nil {
|
||||||
return fmt.Errorf("execute template: %w", err)
|
return fmt.Errorf("execute template: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
// Code generated by kitcom. DO NOT EDIT.
|
||||||
|
|
||||||
import {ParentIPC, ChildIPC} from 'kitten-ipc';
|
import {ParentIPC, ChildIPC} from 'kitten-ipc';
|
||||||
|
|
||||||
{{- /*gotype: efprojects.com/kitten-ipc/kitcom/ts.tsGenData*/ -}}
|
{{- /*gotype: efprojects.com/kitten-ipc/kitcom/ts.tsGenData*/ -}}
|
||||||
|
|||||||
@ -9,8 +9,12 @@ import (
|
|||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
"efprojects.com/kitten-ipc/kitcom/api"
|
"efprojects.com/kitten-ipc/kitcom/api"
|
||||||
|
_ "embed"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//go:embed ts_gen.tmpl
|
||||||
|
var templateString string
|
||||||
|
|
||||||
type tsGenData struct {
|
type tsGenData struct {
|
||||||
Api *api.Api
|
Api *api.Api
|
||||||
}
|
}
|
||||||
@ -37,11 +41,11 @@ func (g *TypescriptApiGenerator) Generate(apis *api.Api, destFile string) error
|
|||||||
return td, nil
|
return td, nil
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
tpl = template.Must(tpl.ParseFiles("./ts/ts_gen.tmpl"))
|
tpl = template.Must(tpl.Parse(templateString))
|
||||||
|
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
|
|
||||||
if err := tpl.ExecuteTemplate(&buf, "ts_gen.tmpl", tplCtx); err != nil {
|
if err := tpl.ExecuteTemplate(&buf, "tsgen", tplCtx); err != nil {
|
||||||
return fmt.Errorf("execute template: %w", err)
|
return fmt.Errorf("execute template: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user