ClientCLIFiles returns the JSON-RPC transport type files.
(genpkg string, services *httpcodegen.ServicesData)
| 9 | |
| 10 | // ClientCLIFiles returns the JSON-RPC transport type files. |
| 11 | func ClientCLIFiles(genpkg string, services *httpcodegen.ServicesData) []*codegen.File { |
| 12 | res := httpcodegen.ClientCLIFiles(genpkg, services) |
| 13 | for _, f := range res { |
| 14 | updateHeader(f) |
| 15 | f.Path = strings.Replace(f.Path, "/http/", "/jsonrpc/", 1) |
| 16 | // Fix JSON-RPC specific template sections |
| 17 | for _, section := range f.SectionTemplates { |
| 18 | if section.Name == "parse-endpoint" { |
| 19 | // Update the template source to use goahttp.ConnConfigureFunc instead of *ConnConfigurer |
| 20 | section.Source = strings.ReplaceAll(section.Source, |
| 21 | "{{ .VarName }}Configurer *{{ .PkgName }}.ConnConfigurer,", |
| 22 | "{{ .VarName }}ConfigFn goahttp.ConnConfigureFunc,") |
| 23 | section.Source = strings.ReplaceAll(section.Source, |
| 24 | ", {{ .VarName }}Configurer{{ end }}", |
| 25 | ", {{ .VarName }}ConfigFn{{ end }}") |
| 26 | } |
| 27 | } |
| 28 | } |
| 29 | return res |
| 30 | } |
nothing calls this directly
no test coverage detected