github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/swarmkit/protobuf/plugin/raftproxy/test/service.proto (about)

     1  // Copyright 2015, Google Inc.
     2  // All rights reserved.
     3  //
     4  // Redistribution and use in source and binary forms, with or without
     5  // modification, are permitted provided that the following conditions are
     6  // met:
     7  //
     8  //   * Redistributions of source code must retain the above copyright
     9  // notice, this list of conditions and the following disclaimer.
    10  //   * Redistributions in binary form must reproduce the above
    11  // copyright notice, this list of conditions and the following disclaimer
    12  // in the documentation and/or other materials provided with the
    13  // distribution.
    14  //   * Neither the name of Google Inc. nor the names of its
    15  // contributors may be used to endorse or promote products derived from
    16  // this software without specific prior written permission.
    17  //
    18  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    19  // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    20  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    21  // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    22  // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    23  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    24  // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    25  // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    26  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    27  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    28  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    29  
    30  // WARNING: This file should be used only in raftproxy tests.
    31  
    32  syntax = "proto3";
    33  
    34  option java_multiple_files = true;
    35  option java_package = "io.grpc.examples.routeguide";
    36  option java_outer_classname = "RouteGuideProto";
    37  option objc_class_prefix = "RTG";
    38  
    39  package routeguide;
    40  
    41  // Interface exported by the server.
    42  service RouteGuide {
    43  	// A simple RPC.
    44  	//
    45  	// Obtains the feature at a given position.
    46  	//
    47  	// A feature with an empty name is returned if there's no feature at the given
    48  	// position.
    49  	rpc GetFeature(Point) returns (Feature) {}
    50  
    51  	// A server-to-client streaming RPC.
    52  	//
    53  	// Obtains the Features available within the given Rectangle.  Results are
    54  	// streamed rather than returned at once (e.g. in a response message with a
    55  	// repeated field), as the rectangle may cover a large area and contain a
    56  	// huge number of features.
    57  	rpc ListFeatures(Rectangle) returns (stream Feature) {}
    58  
    59  	// A client-to-server streaming RPC.
    60  	//
    61  	// Accepts a stream of Points on a route being traversed, returning a
    62  	// RouteSummary when traversal is completed.
    63  	rpc RecordRoute(stream Point) returns (RouteSummary) {}
    64  
    65  	// A Bidirectional streaming RPC.
    66  	//
    67  	// Accepts a stream of RouteNotes sent while a route is being traversed,
    68  	// while receiving other RouteNotes (e.g. from other users).
    69  	rpc RouteChat(stream RouteNote) returns (stream RouteNote) {}
    70  }
    71  
    72  // Points are represented as latitude-longitude pairs in the E7 representation
    73  // (degrees multiplied by 10**7 and rounded to the nearest integer).
    74  // Latitudes should be in the range +/- 90 degrees and longitude should be in
    75  // the range +/- 180 degrees (inclusive).
    76  message Point {
    77  	int32 latitude = 1;
    78  	int32 longitude = 2;
    79  }
    80  
    81  // A latitude-longitude rectangle, represented as two diagonally opposite
    82  // points "lo" and "hi".
    83  message Rectangle {
    84  	// One corner of the rectangle.
    85  	Point lo = 1;
    86  
    87  	// The other corner of the rectangle.
    88  	Point hi = 2;
    89  }
    90  
    91  // A feature names something at a given point.
    92  //
    93  // If a feature could not be named, the name is empty.
    94  message Feature {
    95  	// The name of the feature.
    96  	string name = 1;
    97  
    98  	// The point where the feature is detected.
    99  	Point location = 2;
   100  }
   101  
   102  // A RouteNote is a message sent while at a given point.
   103  message RouteNote {
   104  	// The location from which the message is sent.
   105  	Point location = 1;
   106  
   107  	// The message to be sent.
   108  	string message = 2;
   109  }
   110  
   111  // A RouteSummary is received in response to a RecordRoute rpc.
   112  //
   113  // It contains the number of individual points received, the number of
   114  // detected features, and the total distance covered as the cumulative sum of
   115  // the distance between each point.
   116  message RouteSummary {
   117  	// The number of points received.
   118  	int32 point_count = 1;
   119  
   120  	// The number of known features passed while traversing the route.
   121  	int32 feature_count = 2;
   122  
   123  	// The distance covered in metres.
   124  	int32 distance = 3;
   125  
   126  	// The duration of the traversal in seconds.
   127  	int32 elapsed_time = 4;
   128  }
   129  
   130  service Health {
   131  	rpc Check(HealthCheckRequest) returns (HealthCheckResponse) {};
   132  }
   133  
   134  message HealthCheckRequest {
   135  	string service = 1;
   136  }
   137  
   138  message HealthCheckResponse {
   139  	enum ServingStatus {
   140  		UNKNOWN = 0;
   141  		SERVING = 1;
   142  		NOT_SERVING = 2;
   143  	}
   144  	ServingStatus status = 1;
   145  }