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

Function callUnaryEcho

examples/features/encryption/ALTS/client/main.go:37–45  ·  view source on GitHub ↗
(client ecpb.EchoClient, message string)

Source from the content-addressed store, hash-verified

35var addr = flag.String("addr", "localhost:50051", "the address to connect to")
36
37func callUnaryEcho(client ecpb.EchoClient, message string) {
38 ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
39 defer cancel()
40 resp, err := client.UnaryEcho(ctx, &ecpb.EchoRequest{Message: message})
41 if err != nil {
42 log.Fatalf("client.UnaryEcho(_) = _, %v: ", err)
43 }
44 fmt.Println("UnaryEcho: ", resp.Message)
45}
46
47func main() {
48 flag.Parse()

Callers 1

mainFunction · 0.70

Calls 3

PrintlnMethod · 0.80
UnaryEchoMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected