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

Function ServerFiles

http/codegen/server.go:15–32  ·  view source on GitHub ↗

ServerFiles returns the generated HTTP server files.

(genpkg string, data *ServicesData)

Source from the content-addressed store, hash-verified

13
14// ServerFiles returns the generated HTTP server files.
15func ServerFiles(genpkg string, data *ServicesData) []*codegen.File {
16 files := make([]*codegen.File, 0, len(data.Expressions.Services)*3)
17 for _, svc := range data.Expressions.Services {
18 files = append(files, serverFile(genpkg, svc, data))
19 if f := websocketServerFile(genpkg, svc, data); f != nil {
20 files = append(files, f)
21 }
22 if f := sseServerFile(genpkg, svc, data); f != nil {
23 files = append(files, f)
24 }
25 }
26 for _, svc := range data.Expressions.Services {
27 if f := ServerEncodeDecodeFile(genpkg, svc, data); f != nil {
28 files = append(files, f)
29 }
30 }
31 return files
32}
33
34// serverFile returns the file implementing the HTTP server.
35func serverFile(genpkg string, svc *expr.HTTPServiceExpr, services *ServicesData) *codegen.File {

Callers 15

TestEncodeErrorFunction · 0.70
TestCookieAPIKeySecurityFunction · 0.70
TestServerMountFunction · 0.70
TestServerHandlerFunction · 0.70
TestEncodeFunction · 0.70
TestSSEFunction · 0.70
TestServerStreamingFunction · 0.70
TestDecodeFunction · 0.70
TestHandlerInitFunction · 0.70
TestServerInitFunction · 0.70
TestSSE_MixedResultsFunction · 0.70

Calls 4

ServerEncodeDecodeFileFunction · 0.85
serverFileFunction · 0.70
websocketServerFileFunction · 0.70
sseServerFileFunction · 0.70

Tested by 15

TestEncodeErrorFunction · 0.56
TestCookieAPIKeySecurityFunction · 0.56
TestServerMountFunction · 0.56
TestServerHandlerFunction · 0.56
TestEncodeFunction · 0.56
TestSSEFunction · 0.56
TestServerStreamingFunction · 0.56
TestDecodeFunction · 0.56
TestHandlerInitFunction · 0.56
TestServerInitFunction · 0.56
TestSSE_MixedResultsFunction · 0.56