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)
| 12 | // ClientFiles returns the client files that contain client methods to call the |
| 13 | // corresponding service methods along with the encoding and decoding logic. |
| 14 | func 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. |
| 27 | func clientFile(genpkg string, svc *expr.GRPCServiceExpr, services *ServicesData) *codegen.File { |