| /* |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| */ |
| |
| syntax = "proto3"; |
| |
| // This service definition is used by system_tests_grpc |
| service Friendship { |
| // unary request that receives a person and returns a result |
| rpc Create(Person) returns (CreateResult) {} |
| // bilateral streaming that takes FriendshipRequests and stream FriendshipResponses back |
| rpc MakeFriends(stream FriendshipRequest) returns (stream FriendshipResponse) {} |
| // server streaming method that streams all friends for a given email |
| rpc ListFriends(PersonEmail) returns (stream Person) {} |
| // client streaming method that receive a stream of PersonEmail returning a summary with common friends |
| rpc CommonFriendsCount(stream PersonEmail) returns (CommonFriendsResult) {} |
| } |
| |
| message Person { |
| string email = 1; |
| string name = 2; |
| repeated string friends = 3; |
| } |
| |
| message CreateResult { |
| bool success = 1; |
| string message = 2; |
| } |
| |
| message PersonEmail { |
| string email = 1; |
| } |
| |
| message CommonFriendsResult { |
| repeated string friends = 1; |
| int32 count = 2; |
| } |
| |
| message FriendshipRequest { |
| string email1 = 1; |
| string email2 = 2; |
| } |
| |
| message FriendshipResponse { |
| Person friend1 = 1; |
| Person friend2 = 2; |
| string error = 3; |
| } |