| 1 |
// Copyright 2024 Google LLC |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// http://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, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
// IntStore is a service for testing the rpcreplay package. |
| 16 |
// It is a simple key-value store for integers. |
| 17 |
|
| 18 |
syntax = "proto3"; |
| 19 |
|
| 20 |
package intstore; |
| 21 |
|
| 22 |
option go_package = "cloud.google.com/go/rpcreplay/proto/intstore"; |
| 23 |
|
| 24 |
service IntStore { |
| 25 |
rpc Set(Item) returns (SetResponse) {} |
| 26 |
|
| 27 |
rpc Get(GetRequest) returns (Item) {} |
| 28 |
|
| 29 |
// A server-to-client streaming RPC. |
| 30 |
rpc ListItems(ListItemsRequest) returns (stream Item) {} |
| 31 |
|
| 32 |
// A client-to-server streaming RPC. |
| 33 |
rpc SetStream(stream Item) returns (Summary) {} |
| 34 |
|
| 35 |
// A Bidirectional streaming RPC. |
| 36 |
rpc StreamChat(stream Item) returns (stream Item) {} |
| 37 |
} |
| 38 |
|
| 39 |
message Item { |
| 40 |
string name = 1; |
| 41 |
int32 value = 2; |
| 42 |
} |
| 43 |
|
| 44 |
message SetResponse { |
| 45 |
int32 prev_value = 1; |
| 46 |
} |
| 47 |
|
| 48 |
message GetRequest { |
| 49 |
string name = 1; |
| 50 |
} |
| 51 |
|
| 52 |
message Summary { |
| 53 |
int32 count = 1; |
| 54 |
} |
| 55 |
|
| 56 |
message ListItemsRequest { |
| 57 |
// Only list items whose value is greater than this. |
| 58 |
int32 greaterThan = 1; |
| 59 |
} |