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

Function ServerFiles

grpc/codegen/server.go:16–26  ·  view source on GitHub ↗

ServerFiles returns all the server files for every gRPC service. The files contain the server which implements the generated gRPC server interface and encoders and decoders to transform protocol buffer types and gRPC metadata into goa types and vice versa.

(genpkg string, services *ServicesData)

Source from the content-addressed store, hash-verified

14// encoders and decoders to transform protocol buffer types and gRPC metadata
15// into goa types and vice versa.
16func ServerFiles(genpkg string, services *ServicesData) []*codegen.File {
17 svcLen := len(services.Root.API.GRPC.Services)
18 fw := make([]*codegen.File, 2*svcLen)
19 for i, svc := range services.Root.API.GRPC.Services {
20 fw[i] = serverFile(genpkg, svc, services)
21 }
22 for i, svc := range services.Root.API.GRPC.Services {
23 fw[i+svcLen] = serverEncodeDecode(genpkg, svc, services)
24 }
25 return fw
26}
27
28// serverFile returns the files defining the gRPC server.
29func serverFile(genpkg string, svc *expr.GRPCServiceExpr, services *ServicesData) *codegen.File {

Callers 6

TestServerGRPCInterfaceFunction · 0.70
TestServerHandlerInitFunction · 0.70
TestRequestDecoderFunction · 0.70
TestResponseEncoderFunction · 0.70
TestStreamingFunction · 0.70

Calls 2

serverEncodeDecodeFunction · 0.85
serverFileFunction · 0.70

Tested by 6

TestServerGRPCInterfaceFunction · 0.56
TestServerHandlerInitFunction · 0.56
TestRequestDecoderFunction · 0.56
TestResponseEncoderFunction · 0.56
TestStreamingFunction · 0.56