minor text

This commit is contained in:
Jeff Carr 2025-09-08 05:34:23 -05:00
parent da3244d265
commit 4f114f7046
1 changed files with 6 additions and 4 deletions

View File

@ -34,10 +34,11 @@ func (pb *Files) makeHTTPFile(pf *File) error {
return fmt.Errorf("failed to find struct %s", msg.GuiVarName) return fmt.Errorf("failed to find struct %s", msg.GuiVarName)
} }
FRUITS := msg.Name FRUITS := msg.Name
FRUIT := msg.GuiVarName fRUITS := untitle(FRUITS)
// FRUIT := msg.GuiVarName
// fruitVars := color.Vars // fruitVars := color.Vars
httpSendReply(newf, FRUITS) httpSendReply(newf, FRUITS)
httpCustom(newf, FRUITS, FRUIT, FRUIT) httpPost(newf, FRUITS, fRUITS)
log.Printf("NEED TO ADD GUI FOR %s with var %s and found msg struct %s\n", msg.Name, msg.GuiVarName, color.Lockname) log.Printf("NEED TO ADD GUI FOR %s with var %s and found msg struct %s\n", msg.Name, msg.GuiVarName, color.Lockname)
} }
} }
@ -109,7 +110,7 @@ func httpSendReply(w io.Writer, FRUITS string) {
fmt.Fprintln(w, "}") fmt.Fprintln(w, "}")
} }
func httpCustom(w io.Writer, FRUITS string, fRUITS string, FRUIT string) { func httpPost(w io.Writer, FRUITS string, fRUITS string) {
fmt.Fprintln(w, "// Marshal protobuf, then http POST, then Unmarshal() to protobuf again") fmt.Fprintln(w, "// Marshal protobuf, then http POST, then Unmarshal() to protobuf again")
fmt.Fprintln(w, "func (p *"+FRUITS+") HttpPost(baseURL string, route string) (*"+FRUITS+", *httppb.HttpRequest, error) {") fmt.Fprintln(w, "func (p *"+FRUITS+") HttpPost(baseURL string, route string) (*"+FRUITS+", *httppb.HttpRequest, error) {")
fmt.Fprintln(w, " data, err := p.Marshal()") fmt.Fprintln(w, " data, err := p.Marshal()")
@ -117,7 +118,8 @@ func httpCustom(w io.Writer, FRUITS string, fRUITS string, FRUIT string) {
fmt.Fprintln(w, " return nil, nil, err") fmt.Fprintln(w, " return nil, nil, err")
fmt.Fprintln(w, " }") fmt.Fprintln(w, " }")
fmt.Fprintln(w, "") fmt.Fprintln(w, "")
fmt.Fprintln(w, " reqPB, err := httppb.DoPost(baseURL, route, data)") fmt.Fprintln(w, " tmp := filepath.Join(\""+fRUITS+"\",route)")
fmt.Fprintln(w, " reqPB, err := httppb.DoPost(baseURL, tmp, data)")
fmt.Fprintln(w, " if reqPB == nil {") fmt.Fprintln(w, " if reqPB == nil {")
fmt.Fprintln(w, " return nil, nil, err") fmt.Fprintln(w, " return nil, nil, err")
fmt.Fprintln(w, " }") fmt.Fprintln(w, " }")