1// Code generated by protoc-gen-go. DO NOT EDIT. 2// source: route_guide.proto 3 4/* 5Package routeguide is a generated protocol buffer package. 6 7It is generated from these files: 8 route_guide.proto 9 10It has these top-level messages: 11 Point 12 Rectangle 13 Feature 14 RouteNote 15 RouteSummary 16*/ 17package routeguide 18 19import proto "github.com/golang/protobuf/proto" 20import fmt "fmt" 21import math "math" 22 23import ( 24 context "golang.org/x/net/context" 25 grpc "google.golang.org/grpc" 26) 27 28// Reference imports to suppress errors if they are not otherwise used. 29var _ = proto.Marshal 30var _ = fmt.Errorf 31var _ = math.Inf 32 33// This is a compile-time assertion to ensure that this generated file 34// is compatible with the proto package it is being compiled against. 35// A compilation error at this line likely means your copy of the 36// proto package needs to be updated. 37const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 38 39// Points are represented as latitude-longitude pairs in the E7 representation 40// (degrees multiplied by 10**7 and rounded to the nearest integer). 41// Latitudes should be in the range +/- 90 degrees and longitude should be in 42// the range +/- 180 degrees (inclusive). 43type Point struct { 44 Latitude int32 `protobuf:"varint,1,opt,name=latitude" json:"latitude,omitempty"` 45 Longitude int32 `protobuf:"varint,2,opt,name=longitude" json:"longitude,omitempty"` 46} 47 48func (m *Point) Reset() { *m = Point{} } 49func (m *Point) String() string { return proto.CompactTextString(m) } 50func (*Point) ProtoMessage() {} 51func (*Point) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } 52 53func (m *Point) GetLatitude() int32 { 54 if m != nil { 55 return m.Latitude 56 } 57 return 0 58} 59 60func (m *Point) GetLongitude() int32 { 61 if m != nil { 62 return m.Longitude 63 } 64 return 0 65} 66 67// A latitude-longitude rectangle, represented as two diagonally opposite 68// points "lo" and "hi". 69type Rectangle struct { 70 // One corner of the rectangle. 71 Lo *Point `protobuf:"bytes,1,opt,name=lo" json:"lo,omitempty"` 72 // The other corner of the rectangle. 73 Hi *Point `protobuf:"bytes,2,opt,name=hi" json:"hi,omitempty"` 74} 75 76func (m *Rectangle) Reset() { *m = Rectangle{} } 77func (m *Rectangle) String() string { return proto.CompactTextString(m) } 78func (*Rectangle) ProtoMessage() {} 79func (*Rectangle) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } 80 81func (m *Rectangle) GetLo() *Point { 82 if m != nil { 83 return m.Lo 84 } 85 return nil 86} 87 88func (m *Rectangle) GetHi() *Point { 89 if m != nil { 90 return m.Hi 91 } 92 return nil 93} 94 95// A feature names something at a given point. 96// 97// If a feature could not be named, the name is empty. 98type Feature struct { 99 // The name of the feature. 100 Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` 101 // The point where the feature is detected. 102 Location *Point `protobuf:"bytes,2,opt,name=location" json:"location,omitempty"` 103} 104 105func (m *Feature) Reset() { *m = Feature{} } 106func (m *Feature) String() string { return proto.CompactTextString(m) } 107func (*Feature) ProtoMessage() {} 108func (*Feature) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } 109 110func (m *Feature) GetName() string { 111 if m != nil { 112 return m.Name 113 } 114 return "" 115} 116 117func (m *Feature) GetLocation() *Point { 118 if m != nil { 119 return m.Location 120 } 121 return nil 122} 123 124// A RouteNote is a message sent while at a given point. 125type RouteNote struct { 126 // The location from which the message is sent. 127 Location *Point `protobuf:"bytes,1,opt,name=location" json:"location,omitempty"` 128 // The message to be sent. 129 Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` 130} 131 132func (m *RouteNote) Reset() { *m = RouteNote{} } 133func (m *RouteNote) String() string { return proto.CompactTextString(m) } 134func (*RouteNote) ProtoMessage() {} 135func (*RouteNote) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } 136 137func (m *RouteNote) GetLocation() *Point { 138 if m != nil { 139 return m.Location 140 } 141 return nil 142} 143 144func (m *RouteNote) GetMessage() string { 145 if m != nil { 146 return m.Message 147 } 148 return "" 149} 150 151// A RouteSummary is received in response to a RecordRoute rpc. 152// 153// It contains the number of individual points received, the number of 154// detected features, and the total distance covered as the cumulative sum of 155// the distance between each point. 156type RouteSummary struct { 157 // The number of points received. 158 PointCount int32 `protobuf:"varint,1,opt,name=point_count,json=pointCount" json:"point_count,omitempty"` 159 // The number of known features passed while traversing the route. 160 FeatureCount int32 `protobuf:"varint,2,opt,name=feature_count,json=featureCount" json:"feature_count,omitempty"` 161 // The distance covered in metres. 162 Distance int32 `protobuf:"varint,3,opt,name=distance" json:"distance,omitempty"` 163 // The duration of the traversal in seconds. 164 ElapsedTime int32 `protobuf:"varint,4,opt,name=elapsed_time,json=elapsedTime" json:"elapsed_time,omitempty"` 165} 166 167func (m *RouteSummary) Reset() { *m = RouteSummary{} } 168func (m *RouteSummary) String() string { return proto.CompactTextString(m) } 169func (*RouteSummary) ProtoMessage() {} 170func (*RouteSummary) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } 171 172func (m *RouteSummary) GetPointCount() int32 { 173 if m != nil { 174 return m.PointCount 175 } 176 return 0 177} 178 179func (m *RouteSummary) GetFeatureCount() int32 { 180 if m != nil { 181 return m.FeatureCount 182 } 183 return 0 184} 185 186func (m *RouteSummary) GetDistance() int32 { 187 if m != nil { 188 return m.Distance 189 } 190 return 0 191} 192 193func (m *RouteSummary) GetElapsedTime() int32 { 194 if m != nil { 195 return m.ElapsedTime 196 } 197 return 0 198} 199 200func init() { 201 proto.RegisterType((*Point)(nil), "routeguide.Point") 202 proto.RegisterType((*Rectangle)(nil), "routeguide.Rectangle") 203 proto.RegisterType((*Feature)(nil), "routeguide.Feature") 204 proto.RegisterType((*RouteNote)(nil), "routeguide.RouteNote") 205 proto.RegisterType((*RouteSummary)(nil), "routeguide.RouteSummary") 206} 207 208// Reference imports to suppress errors if they are not otherwise used. 209var _ context.Context 210var _ grpc.ClientConn 211 212// This is a compile-time assertion to ensure that this generated file 213// is compatible with the grpc package it is being compiled against. 214const _ = grpc.SupportPackageIsVersion4 215 216// Client API for RouteGuide service 217 218type RouteGuideClient interface { 219 // A simple RPC. 220 // 221 // Obtains the feature at a given position. 222 // 223 // A feature with an empty name is returned if there's no feature at the given 224 // position. 225 GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) 226 // A server-to-client streaming RPC. 227 // 228 // Obtains the Features available within the given Rectangle. Results are 229 // streamed rather than returned at once (e.g. in a response message with a 230 // repeated field), as the rectangle may cover a large area and contain a 231 // huge number of features. 232 ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (RouteGuide_ListFeaturesClient, error) 233 // A client-to-server streaming RPC. 234 // 235 // Accepts a stream of Points on a route being traversed, returning a 236 // RouteSummary when traversal is completed. 237 RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error) 238 // A Bidirectional streaming RPC. 239 // 240 // Accepts a stream of RouteNotes sent while a route is being traversed, 241 // while receiving other RouteNotes (e.g. from other users). 242 RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error) 243} 244 245type routeGuideClient struct { 246 cc *grpc.ClientConn 247} 248 249func NewRouteGuideClient(cc *grpc.ClientConn) RouteGuideClient { 250 return &routeGuideClient{cc} 251} 252 253func (c *routeGuideClient) GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) { 254 out := new(Feature) 255 err := grpc.Invoke(ctx, "/routeguide.RouteGuide/GetFeature", in, out, c.cc, opts...) 256 if err != nil { 257 return nil, err 258 } 259 return out, nil 260} 261 262func (c *routeGuideClient) ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (RouteGuide_ListFeaturesClient, error) { 263 stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[0], c.cc, "/routeguide.RouteGuide/ListFeatures", opts...) 264 if err != nil { 265 return nil, err 266 } 267 x := &routeGuideListFeaturesClient{stream} 268 if err := x.ClientStream.SendMsg(in); err != nil { 269 return nil, err 270 } 271 if err := x.ClientStream.CloseSend(); err != nil { 272 return nil, err 273 } 274 return x, nil 275} 276 277type RouteGuide_ListFeaturesClient interface { 278 Recv() (*Feature, error) 279 grpc.ClientStream 280} 281 282type routeGuideListFeaturesClient struct { 283 grpc.ClientStream 284} 285 286func (x *routeGuideListFeaturesClient) Recv() (*Feature, error) { 287 m := new(Feature) 288 if err := x.ClientStream.RecvMsg(m); err != nil { 289 return nil, err 290 } 291 return m, nil 292} 293 294func (c *routeGuideClient) RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error) { 295 stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[1], c.cc, "/routeguide.RouteGuide/RecordRoute", opts...) 296 if err != nil { 297 return nil, err 298 } 299 x := &routeGuideRecordRouteClient{stream} 300 return x, nil 301} 302 303type RouteGuide_RecordRouteClient interface { 304 Send(*Point) error 305 CloseAndRecv() (*RouteSummary, error) 306 grpc.ClientStream 307} 308 309type routeGuideRecordRouteClient struct { 310 grpc.ClientStream 311} 312 313func (x *routeGuideRecordRouteClient) Send(m *Point) error { 314 return x.ClientStream.SendMsg(m) 315} 316 317func (x *routeGuideRecordRouteClient) CloseAndRecv() (*RouteSummary, error) { 318 if err := x.ClientStream.CloseSend(); err != nil { 319 return nil, err 320 } 321 m := new(RouteSummary) 322 if err := x.ClientStream.RecvMsg(m); err != nil { 323 return nil, err 324 } 325 return m, nil 326} 327 328func (c *routeGuideClient) RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error) { 329 stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[2], c.cc, "/routeguide.RouteGuide/RouteChat", opts...) 330 if err != nil { 331 return nil, err 332 } 333 x := &routeGuideRouteChatClient{stream} 334 return x, nil 335} 336 337type RouteGuide_RouteChatClient interface { 338 Send(*RouteNote) error 339 Recv() (*RouteNote, error) 340 grpc.ClientStream 341} 342 343type routeGuideRouteChatClient struct { 344 grpc.ClientStream 345} 346 347func (x *routeGuideRouteChatClient) Send(m *RouteNote) error { 348 return x.ClientStream.SendMsg(m) 349} 350 351func (x *routeGuideRouteChatClient) Recv() (*RouteNote, error) { 352 m := new(RouteNote) 353 if err := x.ClientStream.RecvMsg(m); err != nil { 354 return nil, err 355 } 356 return m, nil 357} 358 359// Server API for RouteGuide service 360 361type RouteGuideServer interface { 362 // A simple RPC. 363 // 364 // Obtains the feature at a given position. 365 // 366 // A feature with an empty name is returned if there's no feature at the given 367 // position. 368 GetFeature(context.Context, *Point) (*Feature, error) 369 // A server-to-client streaming RPC. 370 // 371 // Obtains the Features available within the given Rectangle. Results are 372 // streamed rather than returned at once (e.g. in a response message with a 373 // repeated field), as the rectangle may cover a large area and contain a 374 // huge number of features. 375 ListFeatures(*Rectangle, RouteGuide_ListFeaturesServer) error 376 // A client-to-server streaming RPC. 377 // 378 // Accepts a stream of Points on a route being traversed, returning a 379 // RouteSummary when traversal is completed. 380 RecordRoute(RouteGuide_RecordRouteServer) error 381 // A Bidirectional streaming RPC. 382 // 383 // Accepts a stream of RouteNotes sent while a route is being traversed, 384 // while receiving other RouteNotes (e.g. from other users). 385 RouteChat(RouteGuide_RouteChatServer) error 386} 387 388func RegisterRouteGuideServer(s *grpc.Server, srv RouteGuideServer) { 389 s.RegisterService(&_RouteGuide_serviceDesc, srv) 390} 391 392func _RouteGuide_GetFeature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 393 in := new(Point) 394 if err := dec(in); err != nil { 395 return nil, err 396 } 397 if interceptor == nil { 398 return srv.(RouteGuideServer).GetFeature(ctx, in) 399 } 400 info := &grpc.UnaryServerInfo{ 401 Server: srv, 402 FullMethod: "/routeguide.RouteGuide/GetFeature", 403 } 404 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 405 return srv.(RouteGuideServer).GetFeature(ctx, req.(*Point)) 406 } 407 return interceptor(ctx, in, info, handler) 408} 409 410func _RouteGuide_ListFeatures_Handler(srv interface{}, stream grpc.ServerStream) error { 411 m := new(Rectangle) 412 if err := stream.RecvMsg(m); err != nil { 413 return err 414 } 415 return srv.(RouteGuideServer).ListFeatures(m, &routeGuideListFeaturesServer{stream}) 416} 417 418type RouteGuide_ListFeaturesServer interface { 419 Send(*Feature) error 420 grpc.ServerStream 421} 422 423type routeGuideListFeaturesServer struct { 424 grpc.ServerStream 425} 426 427func (x *routeGuideListFeaturesServer) Send(m *Feature) error { 428 return x.ServerStream.SendMsg(m) 429} 430 431func _RouteGuide_RecordRoute_Handler(srv interface{}, stream grpc.ServerStream) error { 432 return srv.(RouteGuideServer).RecordRoute(&routeGuideRecordRouteServer{stream}) 433} 434 435type RouteGuide_RecordRouteServer interface { 436 SendAndClose(*RouteSummary) error 437 Recv() (*Point, error) 438 grpc.ServerStream 439} 440 441type routeGuideRecordRouteServer struct { 442 grpc.ServerStream 443} 444 445func (x *routeGuideRecordRouteServer) SendAndClose(m *RouteSummary) error { 446 return x.ServerStream.SendMsg(m) 447} 448 449func (x *routeGuideRecordRouteServer) Recv() (*Point, error) { 450 m := new(Point) 451 if err := x.ServerStream.RecvMsg(m); err != nil { 452 return nil, err 453 } 454 return m, nil 455} 456 457func _RouteGuide_RouteChat_Handler(srv interface{}, stream grpc.ServerStream) error { 458 return srv.(RouteGuideServer).RouteChat(&routeGuideRouteChatServer{stream}) 459} 460 461type RouteGuide_RouteChatServer interface { 462 Send(*RouteNote) error 463 Recv() (*RouteNote, error) 464 grpc.ServerStream 465} 466 467type routeGuideRouteChatServer struct { 468 grpc.ServerStream 469} 470 471func (x *routeGuideRouteChatServer) Send(m *RouteNote) error { 472 return x.ServerStream.SendMsg(m) 473} 474 475func (x *routeGuideRouteChatServer) Recv() (*RouteNote, error) { 476 m := new(RouteNote) 477 if err := x.ServerStream.RecvMsg(m); err != nil { 478 return nil, err 479 } 480 return m, nil 481} 482 483var _RouteGuide_serviceDesc = grpc.ServiceDesc{ 484 ServiceName: "routeguide.RouteGuide", 485 HandlerType: (*RouteGuideServer)(nil), 486 Methods: []grpc.MethodDesc{ 487 { 488 MethodName: "GetFeature", 489 Handler: _RouteGuide_GetFeature_Handler, 490 }, 491 }, 492 Streams: []grpc.StreamDesc{ 493 { 494 StreamName: "ListFeatures", 495 Handler: _RouteGuide_ListFeatures_Handler, 496 ServerStreams: true, 497 }, 498 { 499 StreamName: "RecordRoute", 500 Handler: _RouteGuide_RecordRoute_Handler, 501 ClientStreams: true, 502 }, 503 { 504 StreamName: "RouteChat", 505 Handler: _RouteGuide_RouteChat_Handler, 506 ServerStreams: true, 507 ClientStreams: true, 508 }, 509 }, 510 Metadata: "route_guide.proto", 511} 512 513func init() { proto.RegisterFile("route_guide.proto", fileDescriptor0) } 514 515var fileDescriptor0 = []byte{ 516 // 404 bytes of a gzipped FileDescriptorProto 517 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xdd, 0xca, 0xd3, 0x40, 518 0x10, 0xfd, 0x36, 0x7e, 0x9f, 0x6d, 0x26, 0x11, 0xe9, 0x88, 0x10, 0xa2, 0xa0, 0x8d, 0x37, 0xbd, 519 0x31, 0x94, 0x0a, 0x5e, 0x56, 0x6c, 0xc1, 0xde, 0x14, 0xa9, 0xb1, 0xf7, 0x65, 0x4d, 0xc6, 0x74, 520 0x61, 0x93, 0x0d, 0xc9, 0x06, 0xf4, 0x01, 0x7c, 0x02, 0x5f, 0x58, 0xb2, 0x49, 0xda, 0x54, 0x5b, 521 0xbc, 0xdb, 0x39, 0x73, 0xce, 0xfc, 0x9c, 0x61, 0x61, 0x52, 0xaa, 0x5a, 0xd3, 0x21, 0xad, 0x45, 522 0x42, 0x61, 0x51, 0x2a, 0xad, 0x10, 0x0c, 0x64, 0x90, 0xe0, 0x23, 0x3c, 0xec, 0x94, 0xc8, 0x35, 523 0xfa, 0x30, 0x96, 0x5c, 0x0b, 0x5d, 0x27, 0xe4, 0xb1, 0xd7, 0x6c, 0xf6, 0x10, 0x9d, 0x62, 0x7c, 524 0x09, 0xb6, 0x54, 0x79, 0xda, 0x26, 0x2d, 0x93, 0x3c, 0x03, 0xc1, 0x17, 0xb0, 0x23, 0x8a, 0x35, 525 0xcf, 0x53, 0x49, 0x38, 0x05, 0x4b, 0x2a, 0x53, 0xc0, 0x59, 0x4c, 0xc2, 0x73, 0xa3, 0xd0, 0x74, 526 0x89, 0x2c, 0xa9, 0x1a, 0xca, 0x51, 0x98, 0x32, 0xd7, 0x29, 0x47, 0x11, 0x6c, 0x61, 0xf4, 0x89, 527 0xb8, 0xae, 0x4b, 0x42, 0x84, 0xfb, 0x9c, 0x67, 0xed, 0x4c, 0x76, 0x64, 0xde, 0xf8, 0x16, 0xc6, 528 0x52, 0xc5, 0x5c, 0x0b, 0x95, 0xdf, 0xae, 0x73, 0xa2, 0x04, 0x7b, 0xb0, 0xa3, 0x26, 0xfb, 0x59, 529 0xe9, 0x4b, 0x2d, 0xfb, 0xaf, 0x16, 0x3d, 0x18, 0x65, 0x54, 0x55, 0x3c, 0x6d, 0x17, 0xb7, 0xa3, 530 0x3e, 0x0c, 0x7e, 0x33, 0x70, 0x4d, 0xd9, 0xaf, 0x75, 0x96, 0xf1, 0xf2, 0x27, 0xbe, 0x02, 0xa7, 531 0x68, 0xd4, 0x87, 0x58, 0xd5, 0xb9, 0xee, 0x4c, 0x04, 0x03, 0xad, 0x1b, 0x04, 0xdf, 0xc0, 0x93, 532 0xef, 0xed, 0x56, 0x1d, 0xa5, 0xb5, 0xd2, 0xed, 0xc0, 0x96, 0xe4, 0xc3, 0x38, 0x11, 0x95, 0xe6, 533 0x79, 0x4c, 0xde, 0xa3, 0xf6, 0x0e, 0x7d, 0x8c, 0x53, 0x70, 0x49, 0xf2, 0xa2, 0xa2, 0xe4, 0xa0, 534 0x45, 0x46, 0xde, 0xbd, 0xc9, 0x3b, 0x1d, 0xb6, 0x17, 0x19, 0x2d, 0x7e, 0x59, 0x00, 0x66, 0xaa, 535 0x4d, 0xb3, 0x0e, 0xbe, 0x07, 0xd8, 0x90, 0xee, 0xbd, 0xfc, 0x77, 0x53, 0xff, 0xd9, 0x10, 0xea, 536 0x78, 0xc1, 0x1d, 0x2e, 0xc1, 0xdd, 0x8a, 0xaa, 0x17, 0x56, 0xf8, 0x7c, 0x48, 0x3b, 0x5d, 0xfb, 537 0x86, 0x7a, 0xce, 0x70, 0x09, 0x4e, 0x44, 0xb1, 0x2a, 0x13, 0x33, 0xcb, 0xb5, 0xc6, 0xde, 0x45, 538 0xc5, 0x81, 0x8f, 0xc1, 0xdd, 0x8c, 0xe1, 0x87, 0xee, 0x64, 0xeb, 0x23, 0xd7, 0x7f, 0x35, 0xef, 539 0x2f, 0xe9, 0x5f, 0x87, 0x1b, 0xf9, 0x9c, 0xad, 0xe6, 0xf0, 0x42, 0xa8, 0x30, 0x2d, 0x8b, 0x38, 540 0xa4, 0x1f, 0x3c, 0x2b, 0x24, 0x55, 0x03, 0xfa, 0xea, 0xe9, 0xd9, 0xa3, 0x5d, 0xf3, 0x27, 0x76, 541 0xec, 0xdb, 0x63, 0xf3, 0x39, 0xde, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0xc8, 0xe4, 0xef, 0xe6, 542 0x31, 0x03, 0x00, 0x00, 543} 544