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

Function updateHeader

jsonrpc/codegen/templates.go:68–79  ·  view source on GitHub ↗

updateHeader modifies the header of the given file to be JSON-RPC specific.

(f *codegen.File)

Source from the content-addressed store, hash-verified

66
67// updateHeader modifies the header of the given file to be JSON-RPC specific.
68func updateHeader(f *codegen.File) {
69 // Update the title
70 header := f.SectionTemplates[0]
71 title := strings.Replace(header.Data.(map[string]any)["Title"].(string), "HTTP", "JSON-RPC", 1)
72 header.Data.(map[string]any)["Title"] = title
73
74 // Update the imports
75 imports := header.Data.(map[string]any)["Imports"].([]*codegen.ImportSpec)
76 for _, i := range imports {
77 i.Path = strings.Replace(i.Path, "gen/http", "gen/jsonrpc", 1)
78 }
79}

Callers 7

ServerFilesFunction · 0.85
ClientCLIFilesFunction · 0.85
PathFilesFunction · 0.85
exampleServerFunction · 0.85
exampleCLIFunction · 0.85
ServerTypeFilesFunction · 0.85
ClientFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected