Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
c1ee3824
Commit
c1ee3824
authored
10 years ago
by
Tim Emiola
Browse files
Options
Downloads
Patches
Plain Diff
Cleans up route_guide.proto
parent
66e79fa3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
protos/route_guide.proto
+40
-44
40 additions, 44 deletions
protos/route_guide.proto
with
40 additions
and
44 deletions
protos/route_guide.proto
+
40
−
44
View file @
c1ee3824
...
@@ -33,23 +33,51 @@ option java_package = "ex.grpc";
...
@@ -33,23 +33,51 @@ option java_package = "ex.grpc";
package
examples
;
package
examples
;
// Interface exported by the server.
service
RouteGuide
{
// A simple RPC.
//
// Obtains the feature at a given position.
rpc
GetFeature
(
Point
)
returns
(
Feature
)
{}
// A server-to-client streaming RPC.
//
// Obtains the Features available within the given Rectangle. Results are
// streamed rather than returned at once (e.g. in a response message with a
// repeated field), as the rectangle may cover a large area and contain a
// huge number of features.
rpc
ListFeatures
(
Rectangle
)
returns
(
stream
Feature
)
{}
// A client-to-server streaming RPC.
//
// Accepts a stream of Points on a route being traversed, returning a
// RouteSummary when traversal is completed.
rpc
RecordRoute
(
stream
Point
)
returns
(
RouteSummary
)
{}
// A Bidirectional streaming RPC.
//
// Accepts a stream of RouteNotes sent while a route is being traversed,
// while receiving other RouteNotes (e.g. from other users).
rpc
RouteChat
(
stream
RouteNote
)
returns
(
stream
RouteNote
)
{}
}
// Points are represented as latitude-longitude pairs in the E7 representation
// Points are represented as latitude-longitude pairs in the E7 representation
// (degrees multiplied by 10**7 and rounded to the nearest integer).
// (degrees multiplied by 10**7 and rounded to the nearest integer).
// Latitudes should be in the range +/- 90 degrees and longitude should be in
// Latitudes should be in the range +/- 90 degrees and longitude should be in
// the range +/- 180 degrees (inclusive).
// the range +/- 180 degrees (inclusive).
message
Point
{
message
Point
{
optional
int32
latitude
=
1
;
int32
latitude
=
1
;
optional
int32
longitude
=
2
;
int32
longitude
=
2
;
}
}
// A latitude-longitude rectangle, represented as two diagonally opposite
// A latitude-longitude rectangle, represented as two diagonally opposite
// points "lo" and "hi".
// points "lo" and "hi".
message
Rectangle
{
message
Rectangle
{
// One corner of the rectangle.
// One corner of the rectangle.
optional
Point
lo
=
1
;
Point
lo
=
1
;
// The other corner of the rectangle.
// The other corner of the rectangle.
optional
Point
hi
=
2
;
Point
hi
=
2
;
}
}
// A feature names something at a given point.
// A feature names something at a given point.
...
@@ -57,19 +85,19 @@ message Rectangle {
...
@@ -57,19 +85,19 @@ message Rectangle {
// If a feature could not be named, the name is empty.
// If a feature could not be named, the name is empty.
message
Feature
{
message
Feature
{
// The name of the feature.
// The name of the feature.
optional
string
name
=
1
;
string
name
=
1
;
// The point where the feature is detected.
// The point where the feature is detected.
optional
Point
location
=
2
;
Point
location
=
2
;
}
}
// A RouteNote is a message sent while at a given point.
// A RouteNote is a message sent while at a given point.
message
RouteNote
{
message
RouteNote
{
// The location from which the message is sent.
// The location from which the message is sent.
optional
Point
location
=
1
;
Point
location
=
1
;
// The message to be sent.
// The message to be sent.
optional
string
message
=
2
;
string
message
=
2
;
}
}
// A RouteSummary is received in response to a RecordRoute rpc.
// A RouteSummary is received in response to a RecordRoute rpc.
...
@@ -79,46 +107,14 @@ message RouteNote {
...
@@ -79,46 +107,14 @@ message RouteNote {
// the distance between each point.
// the distance between each point.
message
RouteSummary
{
message
RouteSummary
{
// The number of points received.
// The number of points received.
optional
int32
point_count
=
1
;
int32
point_count
=
1
;
// The number of known features passed while traversing the route.
// The number of known features passed while traversing the route.
optional
int32
feature_count
=
2
;
int32
feature_count
=
2
;
// The distance covered in metres.
// The distance covered in metres.
optional
int32
distance
=
3
;
int32
distance
=
3
;
// The duration of the traversal in seconds.
// The duration of the traversal in seconds.
optional
int32
elapsed_time
=
4
;
int32
elapsed_time
=
4
;
}
// Interface exported by the server
service
RouteGuide
{
// A simple RPC.
//
// Obtains the feature at a given position.
rpc
GetFeature
(
Point
)
returns
(
Feature
)
{
}
// A server-to-client streaming RPC.
//
// Obtains the Features available within the given Rectangle. Results are
// streamed rather than returned at once (e.g. in a response message with a
// repeated field), as the rectangle may cover a large area and contain a
// huge number of features.
rpc
ListFeatures
(
Rectangle
)
returns
(
stream
Feature
)
{
}
// A client-to-server streaming RPC.
//
// Accepts a stream of Points on a route being traversed, returning a
// RouteSummary when traversal is completed.
rpc
RecordRoute
(
stream
Point
)
returns
(
RouteSummary
)
{
}
// A Bidirectional streaming RPC.
//
// Accepts a stream of RouteNotes sent while a route is being traversed,
// while receiving other RouteNotes (e.g. from other users).
rpc
RouteChat
(
stream
RouteNote
)
returns
(
stream
RouteNote
)
{
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment