client := grpc_testing.NewTestServiceClient(conn) req := &grpc_testing.SimpleRequest{...} resp, err := client.UnaryCall(context.Background(), req) if err != nil {...}
client := grpc_testing.NewTestServiceClient(conn) req := &grpc_testing.StreamingOutputCallRequest{ ResponseParameters: []*grpc_testing.ResponseParameters{...}, } stream, err := client.StreamingOutputCall(context.Background(), req) if err != nil {...} for { resp, err := stream.Recv() if err == io.EOF { break } if err != nil {...} // handle response }This example shows how to make a server streaming call to the TestService. The request includes parameters for the server to generate multiple responses. The response stream is then received in a loop, handling each response until the stream ends. In summary, the TestServiceClient is a Go library for testing the interoperability between gRPC implementations in different languages. It provides client interfaces for various gRPC calls, such as unary calls and server streaming calls. The package library is "google.golang.org/grpc/interop/grpc_testing".