Recovering operational

This commit is contained in:
2021-09-06 10:31:56 -03:00
parent ac8771aac4
commit cfb43ba21d
5 changed files with 7 additions and 33 deletions
-19
View File
@@ -1,19 +0,0 @@
package lib
//type Config struct {
// Gofname string `yaml:"gofname"`
// Goimpldir string `yaml:"goimpldir"`
// Tsfname string `json:"tsfname"`
// Goclifname string `json:"goclifname"`
//}
//
//var config Config
//
//func loadConfig() {
// fname := flag.String("f", ".apigen.yaml", "File with config to load - defaults to '.apigen'")
// flag.Parse()
// bs, err := ioutil.ReadFile(*fname)
// Err(err)
// err = yaml.Unmarshal(bs, &config)
// Err(err)
//}
-6
View File
@@ -112,10 +112,4 @@ func Run() {
if err != nil {
panic(err)
}
//loadConfig()
//
//os.Remove(config.Gofname)
//process(&api)
}
+1 -1
View File
@@ -122,7 +122,7 @@ func invoke(m string, path string, bodyo interface{}) (*json.Decoder, error) {
for k, v := range api.Methods {
WNL(`func %s(req %s) (res %s, err error){`, k, ResDecType(v.ReqType), ResDecType(v.ResType))
WNL(` var dec *json.Decoder
dec, err = invoke("%s", "%s", res)
dec, err = invoke("%s", "%s", req)
if err!=nil{
return
}
+6 -6
View File
@@ -64,15 +64,15 @@ func processGoServerOutput(f string) error {
WNL(` default:
http.Error(w,"Method not allowed",500)`)
WNL(` }`)
}
WNL(` }`)
WNL(` })
return ret
}`)
WNL(` })`)
}
WNL(` return ret
}
`)
for _, v := range api.Methods {
WNL(`func h_%s(w http.ResponseWriter, r *http.Request) {