MCPcopy
hub / github.com/grpc/grpc-go / callUnaryEcho

Function callUnaryEcho

examples/features/interceptor/client/main.go:112–120  ·  view source on GitHub ↗
(client ecpb.EchoClient, message string)

Source from the content-addressed store, hash-verified

110}
111
112func callUnaryEcho(client ecpb.EchoClient, message string) {
113 ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
114 defer cancel()
115 resp, err := client.UnaryEcho(ctx, &ecpb.EchoRequest{Message: message})
116 if err != nil {
117 log.Fatalf("client.UnaryEcho(_) = _, %v: ", err)
118 }
119 fmt.Println("UnaryEcho: ", resp.Message)
120}
121
122func callBidiStreamingEcho(client ecpb.EchoClient) {
123 ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)

Callers 1

mainFunction · 0.70

Calls 3

PrintlnMethod · 0.80
UnaryEchoMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected