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

Function callUnaryEcho

examples/features/multiplex/client/main.go:50–58  ·  view source on GitHub ↗
(client ecpb.EchoClient, message string)

Source from the content-addressed store, hash-verified

48}
49
50func callUnaryEcho(client ecpb.EchoClient, message string) {
51 ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
52 defer cancel()
53 resp, err := client.UnaryEcho(ctx, &ecpb.EchoRequest{Message: message})
54 if err != nil {
55 log.Fatalf("client.UnaryEcho(_) = _, %v: ", err)
56 }
57 fmt.Println("UnaryEcho: ", resp.Message)
58}
59
60func main() {
61 flag.Parse()

Callers 1

mainFunction · 0.70

Calls 3

PrintlnMethod · 0.80
UnaryEchoMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected