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

Function ExampleServerFiles

http/codegen/example_server.go:15–28  ·  view source on GitHub ↗

ExampleServerFiles returns an example http service implementation.

(genpkg string, data *ServicesData)

Source from the content-addressed store, hash-verified

13
14// ExampleServerFiles returns an example http service implementation.
15func ExampleServerFiles(genpkg string, data *ServicesData) []*codegen.File {
16 var fw []*codegen.File
17 for _, svr := range data.Root.API.Servers {
18 if m := ExampleServer(genpkg, data.Root, svr, data); m != nil {
19 fw = append(fw, m)
20 }
21 }
22 for _, svc := range data.Expressions.Services {
23 if f := dummyMultipartFile(genpkg, data.Root, svc, data); f != nil {
24 fw = append(fw, f)
25 }
26 }
27 return fw
28}
29
30// ExampleServer returns an example HTTP server implementation.
31func ExampleServer(genpkg string, root *expr.RootExpr, svr *expr.ServerExpr, services *ServicesData) *codegen.File {

Callers 1

TestExampleServerFilesFunction · 0.70

Calls 2

ExampleServerFunction · 0.85
dummyMultipartFileFunction · 0.85

Tested by 1

TestExampleServerFilesFunction · 0.56