|
|
|
@ -34,18 +34,21 @@ |
|
|
|
|
/*
|
|
|
|
|
A command line tool to talk to a grpc server. |
|
|
|
|
Example of talking to grpc interop server: |
|
|
|
|
grpc_cli call localhost:50051 UnaryCall src/proto/grpc/testing/test.proto \
|
|
|
|
|
"response_size:10" --enable_ssl=false |
|
|
|
|
grpc_cli call localhost:50051 UnaryCall "response_size:10" \
|
|
|
|
|
--proto_file=src/proto/grpc/testing/test.prot --enable_ssl=false |
|
|
|
|
|
|
|
|
|
Options: |
|
|
|
|
1. --proto_path, if your proto file is not under current working directory, |
|
|
|
|
1. --proto_file, use this flag to provide a proto file if the server does |
|
|
|
|
does not have the reflection service. |
|
|
|
|
2. --proto_path, if your proto file is not under current working directory, |
|
|
|
|
use this flag to provide a search root. It should work similar to the |
|
|
|
|
counterpart in protoc. |
|
|
|
|
2. --metadata specifies metadata to be sent to the server, such as: |
|
|
|
|
counterpart in protoc. This option is valid only when proto_file is |
|
|
|
|
provided. |
|
|
|
|
3. --metadata specifies metadata to be sent to the server, such as: |
|
|
|
|
--metadata="MyHeaderKey1:Value1:MyHeaderKey2:Value2" |
|
|
|
|
3. --enable_ssl, whether to use tls. |
|
|
|
|
4. --use_auth, if set to true, attach a GoogleDefaultCredentials to the call |
|
|
|
|
3. --input_binary_file, a file containing the serialized request. The file |
|
|
|
|
4. --enable_ssl, whether to use tls. |
|
|
|
|
5. --use_auth, if set to true, attach a GoogleDefaultCredentials to the call |
|
|
|
|
6. --input_binary_file, a file containing the serialized request. The file |
|
|
|
|
can be generated by calling something like: |
|
|
|
|
protoc --proto_path=src/proto/grpc/testing/ \
|
|
|
|
|
--encode=grpc.testing.SimpleRequest \
|
|
|
|
@ -53,7 +56,7 @@ |
|
|
|
|
< input.txt > input.bin |
|
|
|
|
If this is used and no proto file is provided in the argument list, the |
|
|
|
|
method string has to be exact in the form of /package.service/method. |
|
|
|
|
4. --output_binary_file, a file to write binary format response into, it can |
|
|
|
|
7. --output_binary_file, a file to write binary format response into, it can |
|
|
|
|
be later decoded using protoc: |
|
|
|
|
protoc --proto_path=src/proto/grpc/testing/ \
|
|
|
|
|
--decode=grpc.testing.SimpleResponse \
|
|
|
|
|