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

Function exampleCLI

jsonrpc/codegen/example_cli.go:22–35  ·  view source on GitHub ↗
(genpkg string, data *httpcodegen.ServicesData, svr *expr.ServerExpr)

Source from the content-addressed store, hash-verified

20}
21
22func exampleCLI(genpkg string, data *httpcodegen.ServicesData, svr *expr.ServerExpr) *codegen.File {
23 f := httpcodegen.ExampleCLI(genpkg, svr, data)
24 if f == nil {
25 return nil
26 }
27 f.Path = strings.Replace(f.Path, "http.go", "jsonrpc.go", 1)
28 updateHeader(f)
29 for _, s := range f.SectionTemplates {
30 s.Source = strings.ReplaceAll(s.Source, "doHTTP", "doJSONRPC")
31 s.Source = strings.ReplaceAll(s.Source, "httpUsage", "jsonrpcUsage")
32 }
33
34 return f
35}

Callers 1

ExampleCLIFilesFunction · 0.70

Calls 1

updateHeaderFunction · 0.85

Tested by

no test coverage detected