1// Copyright 2021 The Pigweed Authors 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); you may not 4// use this file except in compliance with the License. You may obtain a copy of 5// the License at 6// 7// https://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12// License for the specific language governing permissions and limitations under 13// the License. 14 15// Protobuf definition to use in tests. 16syntax = "proto3"; 17 18package pw.rpc.test1; 19 20option java_multiple_files = true; 21option java_package = "dev.pigweed.pw_rpc"; 22 23message SomeMessage { 24 uint32 magic_number = 1; 25} 26 27message AnotherMessage { 28 enum Result { 29 FAILED = 0; 30 FAILED_MISERABLY = 1; 31 I_DONT_WANT_TO_TALK_ABOUT_IT = 2; 32 } 33 34 Result result = 1; 35 string payload = 2; 36} 37 38service TheTestService { 39 // Unary RPC for testing 40 rpc SomeUnary(SomeMessage) returns (AnotherMessage) {} 41 42 // Server streaming RPC for testing 43 rpc SomeServerStreaming(SomeMessage) returns (stream AnotherMessage) {} 44 45 // Client streaming RPC for testing 46 rpc SomeClientStreaming(stream SomeMessage) returns (AnotherMessage) {} 47 48 // Bidirectional streaming RPC for testing 49 rpc SomeBidiStreaming(stream SomeMessage) returns (stream AnotherMessage) {} 50} 51