dubbo.apache.org/dubbo-go/v3@v3.1.1/protocol/grpc/internal/routeguide/routeguide.proto (about) 1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 syntax = "proto3"; 19 20 option java_multiple_files = true; 21 option java_package = "io.grpc.examples.routeguide"; 22 option java_outer_classname = "RouteGuideProto"; 23 option objc_class_prefix = "HLW"; 24 25 package routeguide; 26 27 // Interface exported by the server. 28 service RouteGuide { 29 // A simple RPC. 30 // 31 // Obtains the feature at a given position. 32 // 33 // A feature with an empty name is returned if there's no feature at the given 34 // position. 35 rpc GetFeature(Point) returns (Feature) {} 36 37 // A server-to-client streaming RPC. 38 // 39 // Obtains the Features available within the given Rectangle. Results are 40 // streamed rather than returned at once (e.g. in a response message with a 41 // repeated field), as the rectangle may cover a large area and contain a 42 // huge number of features. 43 rpc ListFeatures(Rectangle) returns (stream Feature) {} 44 45 // A client-to-server streaming RPC. 46 // 47 // Accepts a stream of Points on a route being traversed, returning a 48 // RouteSummary when traversal is completed. 49 rpc RecordRoute(stream Point) returns (RouteSummary) {} 50 51 // A Bidirectional streaming RPC. 52 // 53 // Accepts a stream of RouteNotes sent while a route is being traversed, 54 // while receiving other RouteNotes (e.g. from other users). 55 rpc RouteChat(stream RouteNote) returns (stream RouteNote) {} 56 } 57 58 // Points are represented as latitude-longitude pairs in the E7 representation 59 // (degrees multiplied by 10**7 and rounded to the nearest integer). 60 // Latitudes should be in the range +/- 90 degrees and longitude should be in 61 // the range +/- 180 degrees (inclusive). 62 message Point { 63 int32 latitude = 1; 64 int32 longitude = 2; 65 } 66 67 // A latitude-longitude rectangle, represented as two diagonally opposite 68 // points "lo" and "hi". 69 message Rectangle { 70 // One corner of the rectangle. 71 Point lo = 1; 72 73 // The other corner of the rectangle. 74 Point hi = 2; 75 } 76 77 // A feature names something at a given point. 78 // 79 // If a feature could not be named, the name is empty. 80 message Feature { 81 // The name of the feature. 82 string name = 1; 83 84 // The point where the feature is detected. 85 Point location = 2; 86 } 87 88 // A RouteNote is a message sent while at a given point. 89 message RouteNote { 90 // The location from which the message is sent. 91 Point location = 1; 92 93 // The message to be sent. 94 string message = 2; 95 } 96 97 // A RouteSummary is received in response to a RecordRoute rpc. 98 // 99 // It contains the number of individual points received, the number of 100 // detected features, and the total distance covered as the cumulative sum of 101 // the distance between each point. 102 message RouteSummary { 103 // The number of points received. 104 int32 point_count = 1; 105 106 // The number of known features passed while traversing the route. 107 int32 feature_count = 2; 108 109 // The distance covered in meters. 110 int32 distance = 3; 111 112 // The duration of the traversal in seconds. 113 int32 elapsed_time = 4; 114 }