()
| 145 | } |
| 146 | |
| 147 | func main() { |
| 148 | flag.Parse() |
| 149 | |
| 150 | // Create tls based credential. |
| 151 | creds, err := credentials.NewClientTLSFromFile(data.Path("x509/ca_cert.pem"), "x.test.example.com") |
| 152 | if err != nil { |
| 153 | log.Fatalf("failed to load credentials: %v", err) |
| 154 | } |
| 155 | |
| 156 | // Set up a connection to the server. |
| 157 | conn, err := grpc.NewClient(*addr, grpc.WithTransportCredentials(creds), grpc.WithUnaryInterceptor(unaryInterceptor), grpc.WithStreamInterceptor(streamInterceptor)) |
| 158 | if err != nil { |
| 159 | log.Fatalf("did not connect: %v", err) |
| 160 | } |
| 161 | defer conn.Close() |
| 162 | |
| 163 | // Make an echo client and send RPCs. |
| 164 | rgc := ecpb.NewEchoClient(conn) |
| 165 | callUnaryEcho(rgc, "hello world") |
| 166 | callBidiStreamingEcho(rgc) |
| 167 | } |
nothing calls this directly
no test coverage detected