| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Command rpc can make RPCs to pRPC servers and display their description. |
| 6 // |
| 7 // Subcommand call |
| 8 // |
| 9 // call subcommand reads from stdin, sends a request to a specified service |
| 10 // at a specified server in a special format (defaults to json) and |
| 11 // prints the response back to stdout. |
| 12 // |
| 13 // $ echo '{"name": "Lucy"}' | rpc call :8080 helloworld.Greeter.SayHello |
| 14 // { |
| 15 // "message": "Hello Lucy" |
| 16 // } |
| 17 // |
| 18 // Subcommand show |
| 19 // |
| 20 // show subcommand resolves a name and describes the referenced entity |
| 21 // in proto-like syntax. If name is not specified, lists available services. |
| 22 // |
| 23 // $ rpc show :8080 |
| 24 // helloworld.Greeter |
| 25 // discovery.Discovery |
| 26 // |
| 27 // Show a service: |
| 28 // |
| 29 // $ rpc show :8080 helloworld.Greeter |
| 30 // // The greeting service definition. |
| 31 // service Greeter { |
| 32 // // Sends a greeting |
| 33 // rpc SayHello(HelloRequest) returns (HelloReply) {}; |
| 34 // } |
| 35 // |
| 36 // Show a method: |
| 37 // |
| 38 // $ rpc show :8080 helloworld.Greeter.SayHello |
| 39 // // The greeting service definition. |
| 40 // service Greeter { |
| 41 // // Sends a greeting |
| 42 // rpc SayHello(HelloRequest) returns (HelloReply) {}; |
| 43 // } |
| 44 // |
| 45 // // The request message containing the user's name. |
| 46 // message HelloRequest { |
| 47 // string name = 1; |
| 48 // } |
| 49 // |
| 50 // // The response message containing the greetings |
| 51 // message HelloReply { |
| 52 // string message = 1; |
| 53 // } |
| 54 // |
| 55 // Show a type: |
| 56 // |
| 57 // $ rpc show :8080 helloworld.HelloReply |
| 58 // // The response message containing the greetings |
| 59 // message HelloReply { |
| 60 // string message = 1; |
| 61 // } |
| 62 package main |
| OLD | NEW |