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

Function ClientFiles

grpc/codegen/client.go:14–24  ·  view source on GitHub ↗

ClientFiles returns the client files that contain client methods to call the corresponding service methods along with the encoding and decoding logic.

(genpkg string, services *ServicesData)

Source from the content-addressed store, hash-verified

12// ClientFiles returns the client files that contain client methods to call the
13// corresponding service methods along with the encoding and decoding logic.
14func ClientFiles(genpkg string, services *ServicesData) []*codegen.File {
15 svcLen := len(services.Root.API.GRPC.Services)
16 fw := make([]*codegen.File, 2*svcLen)
17 for i, svc := range services.Root.API.GRPC.Services {
18 fw[i] = clientFile(genpkg, svc, services)
19 }
20 for i, svc := range services.Root.API.GRPC.Services {
21 fw[i+svcLen] = clientEncodeDecode(genpkg, svc, services)
22 }
23 return fw
24}
25
26// clientFile returns the file implementing the gRPC client.
27func clientFile(genpkg string, svc *expr.GRPCServiceExpr, services *ServicesData) *codegen.File {

Callers 8

TestClientEndpointInitFunction · 0.70
TestRequestEncoderFunction · 0.70
TestResponseDecoderFunction · 0.70
TestStreamingFunction · 0.70
TestStreamingWithErrorsFunction · 0.70

Calls 2

clientEncodeDecodeFunction · 0.85
clientFileFunction · 0.70

Tested by 8

TestClientEndpointInitFunction · 0.56
TestRequestEncoderFunction · 0.56
TestResponseDecoderFunction · 0.56
TestStreamingFunction · 0.56
TestStreamingWithErrorsFunction · 0.56