MCPcopy Create free account
hub / github.com/goadesign/goa / ClientCLIFiles

Function ClientCLIFiles

jsonrpc/codegen/client_cli.go:11–30  ·  view source on GitHub ↗

ClientCLIFiles returns the JSON-RPC transport type files.

(genpkg string, services *httpcodegen.ServicesData)

Source from the content-addressed store, hash-verified

9
10// ClientCLIFiles returns the JSON-RPC transport type files.
11func 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}

Callers

nothing calls this directly

Calls 1

updateHeaderFunction · 0.85

Tested by

no test coverage detected