| /* |
| * Licensed to the Apache Software Foundation (ASF) under one or more |
| * contributor license agreements. See the NOTICE file distributed with |
| * this work for additional information regarding copyright ownership. |
| * The ASF licenses this file to You under the Apache License, Version 2.0 |
| * (the "License"); you may not use this file except in compliance with |
| * the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| // Code generated by protoc-gen-go. DO NOT EDIT. |
| // source: routeguide.proto |
| |
| package routeguide |
| |
| import ( |
| context "context" |
| fmt "fmt" |
| math "math" |
| ) |
| |
| import ( |
| proto "github.com/golang/protobuf/proto" |
| grpc "google.golang.org/grpc" |
| codes "google.golang.org/grpc/codes" |
| status "google.golang.org/grpc/status" |
| ) |
| |
| import ( |
| "dubbo.apache.org/dubbo-go/v3/protocol" |
| "dubbo.apache.org/dubbo-go/v3/protocol/invocation" |
| ) |
| |
| // Reference imports to suppress errors if they are not otherwise used. |
| var _ = proto.Marshal |
| var _ = fmt.Errorf |
| var _ = math.Inf |
| |
| // This is a compile-time assertion to ensure that this generated file |
| // is compatible with the proto package it is being compiled against. |
| // A compilation error at this line likely means your copy of the |
| // proto package needs to be updated. |
| const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package |
| |
| // Points are represented as latitude-longitude pairs in the E7 representation |
| // (degrees multiplied by 10**7 and rounded to the nearest integer). |
| // Latitudes should be in the range +/- 90 degrees and longitude should be in |
| // the range +/- 180 degrees (inclusive). |
| type Point struct { |
| Latitude int32 `protobuf:"varint,1,opt,name=latitude,proto3" json:"latitude,omitempty"` |
| Longitude int32 `protobuf:"varint,2,opt,name=longitude,proto3" json:"longitude,omitempty"` |
| XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| XXX_unrecognized []byte `json:"-"` |
| XXX_sizecache int32 `json:"-"` |
| } |
| |
| func (m *Point) Reset() { *m = Point{} } |
| func (m *Point) String() string { return proto.CompactTextString(m) } |
| func (*Point) ProtoMessage() {} |
| func (*Point) Descriptor() ([]byte, []int) { |
| return fileDescriptor_f4a1fa0460de48b1, []int{0} |
| } |
| |
| func (m *Point) XXX_Unmarshal(b []byte) error { |
| return xxx_messageInfo_Point.Unmarshal(m, b) |
| } |
| func (m *Point) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| return xxx_messageInfo_Point.Marshal(b, m, deterministic) |
| } |
| func (m *Point) XXX_Merge(src proto.Message) { |
| xxx_messageInfo_Point.Merge(m, src) |
| } |
| func (m *Point) XXX_Size() int { |
| return xxx_messageInfo_Point.Size(m) |
| } |
| func (m *Point) XXX_DiscardUnknown() { |
| xxx_messageInfo_Point.DiscardUnknown(m) |
| } |
| |
| var xxx_messageInfo_Point proto.InternalMessageInfo |
| |
| func (m *Point) GetLatitude() int32 { |
| if m != nil { |
| return m.Latitude |
| } |
| return 0 |
| } |
| |
| func (m *Point) GetLongitude() int32 { |
| if m != nil { |
| return m.Longitude |
| } |
| return 0 |
| } |
| |
| // A latitude-longitude rectangle, represented as two diagonally opposite |
| // points "lo" and "hi". |
| type Rectangle struct { |
| // One corner of the rectangle. |
| Lo *Point `protobuf:"bytes,1,opt,name=lo,proto3" json:"lo,omitempty"` |
| // The other corner of the rectangle. |
| Hi *Point `protobuf:"bytes,2,opt,name=hi,proto3" json:"hi,omitempty"` |
| XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| XXX_unrecognized []byte `json:"-"` |
| XXX_sizecache int32 `json:"-"` |
| } |
| |
| func (m *Rectangle) Reset() { *m = Rectangle{} } |
| func (m *Rectangle) String() string { return proto.CompactTextString(m) } |
| func (*Rectangle) ProtoMessage() {} |
| func (*Rectangle) Descriptor() ([]byte, []int) { |
| return fileDescriptor_f4a1fa0460de48b1, []int{1} |
| } |
| |
| func (m *Rectangle) XXX_Unmarshal(b []byte) error { |
| return xxx_messageInfo_Rectangle.Unmarshal(m, b) |
| } |
| func (m *Rectangle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| return xxx_messageInfo_Rectangle.Marshal(b, m, deterministic) |
| } |
| func (m *Rectangle) XXX_Merge(src proto.Message) { |
| xxx_messageInfo_Rectangle.Merge(m, src) |
| } |
| func (m *Rectangle) XXX_Size() int { |
| return xxx_messageInfo_Rectangle.Size(m) |
| } |
| func (m *Rectangle) XXX_DiscardUnknown() { |
| xxx_messageInfo_Rectangle.DiscardUnknown(m) |
| } |
| |
| var xxx_messageInfo_Rectangle proto.InternalMessageInfo |
| |
| func (m *Rectangle) GetLo() *Point { |
| if m != nil { |
| return m.Lo |
| } |
| return nil |
| } |
| |
| func (m *Rectangle) GetHi() *Point { |
| if m != nil { |
| return m.Hi |
| } |
| return nil |
| } |
| |
| // A feature names something at a given point. |
| // |
| // If a feature could not be named, the name is empty. |
| type Feature struct { |
| // The name of the feature. |
| Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
| // The point where the feature is detected. |
| Location *Point `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"` |
| XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| XXX_unrecognized []byte `json:"-"` |
| XXX_sizecache int32 `json:"-"` |
| } |
| |
| func (m *Feature) Reset() { *m = Feature{} } |
| func (m *Feature) String() string { return proto.CompactTextString(m) } |
| func (*Feature) ProtoMessage() {} |
| func (*Feature) Descriptor() ([]byte, []int) { |
| return fileDescriptor_f4a1fa0460de48b1, []int{2} |
| } |
| |
| func (m *Feature) XXX_Unmarshal(b []byte) error { |
| return xxx_messageInfo_Feature.Unmarshal(m, b) |
| } |
| func (m *Feature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| return xxx_messageInfo_Feature.Marshal(b, m, deterministic) |
| } |
| func (m *Feature) XXX_Merge(src proto.Message) { |
| xxx_messageInfo_Feature.Merge(m, src) |
| } |
| func (m *Feature) XXX_Size() int { |
| return xxx_messageInfo_Feature.Size(m) |
| } |
| func (m *Feature) XXX_DiscardUnknown() { |
| xxx_messageInfo_Feature.DiscardUnknown(m) |
| } |
| |
| var xxx_messageInfo_Feature proto.InternalMessageInfo |
| |
| func (m *Feature) GetName() string { |
| if m != nil { |
| return m.Name |
| } |
| return "" |
| } |
| |
| func (m *Feature) GetLocation() *Point { |
| if m != nil { |
| return m.Location |
| } |
| return nil |
| } |
| |
| // A RouteNote is a message sent while at a given point. |
| type RouteNote struct { |
| // The location from which the message is sent. |
| Location *Point `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"` |
| // The message to be sent. |
| Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` |
| XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| XXX_unrecognized []byte `json:"-"` |
| XXX_sizecache int32 `json:"-"` |
| } |
| |
| func (m *RouteNote) Reset() { *m = RouteNote{} } |
| func (m *RouteNote) String() string { return proto.CompactTextString(m) } |
| func (*RouteNote) ProtoMessage() {} |
| func (*RouteNote) Descriptor() ([]byte, []int) { |
| return fileDescriptor_f4a1fa0460de48b1, []int{3} |
| } |
| |
| func (m *RouteNote) XXX_Unmarshal(b []byte) error { |
| return xxx_messageInfo_RouteNote.Unmarshal(m, b) |
| } |
| func (m *RouteNote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| return xxx_messageInfo_RouteNote.Marshal(b, m, deterministic) |
| } |
| func (m *RouteNote) XXX_Merge(src proto.Message) { |
| xxx_messageInfo_RouteNote.Merge(m, src) |
| } |
| func (m *RouteNote) XXX_Size() int { |
| return xxx_messageInfo_RouteNote.Size(m) |
| } |
| func (m *RouteNote) XXX_DiscardUnknown() { |
| xxx_messageInfo_RouteNote.DiscardUnknown(m) |
| } |
| |
| var xxx_messageInfo_RouteNote proto.InternalMessageInfo |
| |
| func (m *RouteNote) GetLocation() *Point { |
| if m != nil { |
| return m.Location |
| } |
| return nil |
| } |
| |
| func (m *RouteNote) GetMessage() string { |
| if m != nil { |
| return m.Message |
| } |
| return "" |
| } |
| |
| // A RouteSummary is received in response to a RecordRoute rpc. |
| // |
| // It contains the number of individual points received, the number of |
| // detected features, and the total distance covered as the cumulative sum of |
| // the distance between each point. |
| type RouteSummary struct { |
| // The number of points received. |
| PointCount int32 `protobuf:"varint,1,opt,name=point_count,json=pointCount,proto3" json:"point_count,omitempty"` |
| // The number of known features passed while traversing the route. |
| FeatureCount int32 `protobuf:"varint,2,opt,name=feature_count,json=featureCount,proto3" json:"feature_count,omitempty"` |
| // The distance covered in meters. |
| Distance int32 `protobuf:"varint,3,opt,name=distance,proto3" json:"distance,omitempty"` |
| // The duration of the traversal in seconds. |
| ElapsedTime int32 `protobuf:"varint,4,opt,name=elapsed_time,json=elapsedTime,proto3" json:"elapsed_time,omitempty"` |
| XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| XXX_unrecognized []byte `json:"-"` |
| XXX_sizecache int32 `json:"-"` |
| } |
| |
| func (m *RouteSummary) Reset() { *m = RouteSummary{} } |
| func (m *RouteSummary) String() string { return proto.CompactTextString(m) } |
| func (*RouteSummary) ProtoMessage() {} |
| func (*RouteSummary) Descriptor() ([]byte, []int) { |
| return fileDescriptor_f4a1fa0460de48b1, []int{4} |
| } |
| |
| func (m *RouteSummary) XXX_Unmarshal(b []byte) error { |
| return xxx_messageInfo_RouteSummary.Unmarshal(m, b) |
| } |
| func (m *RouteSummary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| return xxx_messageInfo_RouteSummary.Marshal(b, m, deterministic) |
| } |
| func (m *RouteSummary) XXX_Merge(src proto.Message) { |
| xxx_messageInfo_RouteSummary.Merge(m, src) |
| } |
| func (m *RouteSummary) XXX_Size() int { |
| return xxx_messageInfo_RouteSummary.Size(m) |
| } |
| func (m *RouteSummary) XXX_DiscardUnknown() { |
| xxx_messageInfo_RouteSummary.DiscardUnknown(m) |
| } |
| |
| var xxx_messageInfo_RouteSummary proto.InternalMessageInfo |
| |
| func (m *RouteSummary) GetPointCount() int32 { |
| if m != nil { |
| return m.PointCount |
| } |
| return 0 |
| } |
| |
| func (m *RouteSummary) GetFeatureCount() int32 { |
| if m != nil { |
| return m.FeatureCount |
| } |
| return 0 |
| } |
| |
| func (m *RouteSummary) GetDistance() int32 { |
| if m != nil { |
| return m.Distance |
| } |
| return 0 |
| } |
| |
| func (m *RouteSummary) GetElapsedTime() int32 { |
| if m != nil { |
| return m.ElapsedTime |
| } |
| return 0 |
| } |
| |
| func init() { |
| proto.RegisterType((*Point)(nil), "routeguide.Point") |
| proto.RegisterType((*Rectangle)(nil), "routeguide.Rectangle") |
| proto.RegisterType((*Feature)(nil), "routeguide.Feature") |
| proto.RegisterType((*RouteNote)(nil), "routeguide.RouteNote") |
| proto.RegisterType((*RouteSummary)(nil), "routeguide.RouteSummary") |
| } |
| |
| func init() { proto.RegisterFile("routeguide.proto", fileDescriptor_f4a1fa0460de48b1) } |
| |
| var fileDescriptor_f4a1fa0460de48b1 = []byte{ |
| // 412 bytes of a gzipped FileDescriptorProto |
| 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xdd, 0x8a, 0xd3, 0x40, |
| 0x14, 0xde, 0xc9, 0xee, 0xba, 0xcd, 0x49, 0x44, 0x3d, 0x22, 0x84, 0x28, 0xe8, 0xc6, 0x9b, 0xbd, |
| 0x31, 0x94, 0x0a, 0xbd, 0xac, 0xd8, 0x82, 0xf5, 0xa2, 0x48, 0x8d, 0x05, 0x2f, 0xcb, 0x98, 0x1c, |
| 0xd3, 0x81, 0x49, 0x26, 0x24, 0x13, 0xd0, 0x07, 0xf0, 0x09, 0x7c, 0x03, 0x9f, 0x54, 0x32, 0x49, |
| 0xda, 0x54, 0x5b, 0xf6, 0x6e, 0xce, 0x77, 0xbe, 0xef, 0xfc, 0x7c, 0x87, 0x81, 0xc7, 0xa5, 0xaa, |
| 0x35, 0xa5, 0xb5, 0x48, 0x28, 0x2c, 0x4a, 0xa5, 0x15, 0xc2, 0x01, 0x09, 0xde, 0xc3, 0xf5, 0x5a, |
| 0x89, 0x5c, 0xa3, 0x0f, 0x23, 0xc9, 0xb5, 0xd0, 0x75, 0x42, 0x1e, 0x7b, 0xc5, 0xee, 0xae, 0xa3, |
| 0x7d, 0x8c, 0x2f, 0xc0, 0x96, 0x2a, 0x4f, 0xdb, 0xa4, 0x65, 0x92, 0x07, 0x20, 0xf8, 0x0c, 0x76, |
| 0x44, 0xb1, 0xe6, 0x79, 0x2a, 0x09, 0x6f, 0xc1, 0x92, 0xca, 0x14, 0x70, 0x26, 0x4f, 0xc2, 0x41, |
| 0x6b, 0xd3, 0x25, 0xb2, 0xa4, 0x6a, 0x28, 0x3b, 0x61, 0xca, 0x9c, 0xa6, 0xec, 0x44, 0xb0, 0x82, |
| 0x9b, 0x0f, 0xc4, 0x75, 0x5d, 0x12, 0x22, 0x5c, 0xe5, 0x3c, 0x6b, 0x67, 0xb2, 0x23, 0xf3, 0xc6, |
| 0x37, 0x30, 0x92, 0x2a, 0xe6, 0x5a, 0xa8, 0xfc, 0x7c, 0x9d, 0x3d, 0x25, 0xd8, 0x80, 0x1d, 0x35, |
| 0xd9, 0x4f, 0x4a, 0x1f, 0x6b, 0xd9, 0xbd, 0x5a, 0xf4, 0xe0, 0x26, 0xa3, 0xaa, 0xe2, 0x69, 0xbb, |
| 0xb8, 0x1d, 0xf5, 0x61, 0xf0, 0x9b, 0x81, 0x6b, 0xca, 0x7e, 0xa9, 0xb3, 0x8c, 0x97, 0x3f, 0xf1, |
| 0x25, 0x38, 0x45, 0xa3, 0xde, 0xc6, 0xaa, 0xce, 0x75, 0x67, 0x22, 0x18, 0x68, 0xd1, 0x20, 0xf8, |
| 0x1a, 0x1e, 0x7e, 0x6f, 0xb7, 0xea, 0x28, 0xad, 0x95, 0x6e, 0x07, 0xb6, 0x24, 0x1f, 0x46, 0x89, |
| 0xa8, 0x34, 0xcf, 0x63, 0xf2, 0x2e, 0xdb, 0x3b, 0xf4, 0x31, 0xde, 0x82, 0x4b, 0x92, 0x17, 0x15, |
| 0x25, 0x5b, 0x2d, 0x32, 0xf2, 0xae, 0x4c, 0xde, 0xe9, 0xb0, 0x8d, 0xc8, 0x68, 0xf2, 0xcb, 0x02, |
| 0x30, 0x53, 0x2d, 0x9b, 0x75, 0x70, 0x0a, 0xb0, 0x24, 0xdd, 0x7b, 0xf9, 0xff, 0xa6, 0xfe, 0xd3, |
| 0x21, 0xd4, 0xf1, 0x82, 0x0b, 0x9c, 0x81, 0xbb, 0x12, 0x55, 0x2f, 0xac, 0xf0, 0xd9, 0x90, 0xb6, |
| 0xbf, 0xf6, 0x19, 0xf5, 0x98, 0xe1, 0x0c, 0x9c, 0x88, 0x62, 0x55, 0x26, 0x66, 0x96, 0x53, 0x8d, |
| 0xbd, 0xa3, 0x8a, 0x03, 0x1f, 0x83, 0x8b, 0x3b, 0x86, 0xef, 0xba, 0x93, 0x2d, 0x76, 0x5c, 0xff, |
| 0xd3, 0xbc, 0xbf, 0xa4, 0x7f, 0x1a, 0x6e, 0xe4, 0x63, 0x36, 0x9f, 0xc2, 0x73, 0xa1, 0xc2, 0xb4, |
| 0x2c, 0xe2, 0x90, 0x7e, 0xf0, 0xac, 0x90, 0x54, 0x0d, 0xe8, 0xf3, 0x47, 0x07, 0x8f, 0xd6, 0xcd, |
| 0x9f, 0x58, 0xb3, 0x3f, 0xd6, 0xe5, 0xc7, 0xd5, 0xd7, 0x6f, 0x0f, 0xcc, 0x17, 0x79, 0xfb, 0x37, |
| 0x00, 0x00, 0xff, 0xff, 0xb0, 0xf5, 0x6a, 0xe0, 0x36, 0x03, 0x00, 0x00, |
| } |
| |
| // Reference imports to suppress errors if they are not otherwise used. |
| var _ context.Context |
| var _ grpc.ClientConnInterface |
| |
| // This is a compile-time assertion to ensure that this generated file |
| // is compatible with the grpc package it is being compiled against. |
| const _ = grpc.SupportPackageIsVersion6 |
| |
| // RouteGuideClient is the client API for RouteGuide service. |
| // |
| // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. |
| type RouteGuideClient interface { |
| // A simple RPC. |
| // |
| // Obtains the feature at a given position. |
| // |
| // A feature with an empty name is returned if there's no feature at the given |
| // position. |
| GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) |
| // 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. |
| ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (RouteGuide_ListFeaturesClient, error) |
| // A client-to-server streaming RPC. |
| // |
| // Accepts a stream of Points on a route being traversed, returning a |
| // RouteSummary when traversal is completed. |
| RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error) |
| // 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). |
| RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error) |
| } |
| |
| type routeGuideClient struct { |
| cc grpc.ClientConnInterface |
| } |
| |
| func NewRouteGuideClient(cc grpc.ClientConnInterface) RouteGuideClient { |
| return &routeGuideClient{cc} |
| } |
| |
| func (c *routeGuideClient) GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) { |
| out := new(Feature) |
| err := c.cc.Invoke(ctx, "/routeguide.RouteGuide/GetFeature", in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| func (c *routeGuideClient) ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (RouteGuide_ListFeaturesClient, error) { |
| stream, err := c.cc.NewStream(ctx, &_RouteGuide_serviceDesc.Streams[0], "/routeguide.RouteGuide/ListFeatures", opts...) |
| if err != nil { |
| return nil, err |
| } |
| x := &routeGuideListFeaturesClient{stream} |
| if err := x.ClientStream.SendMsg(in); err != nil { |
| return nil, err |
| } |
| if err := x.ClientStream.CloseSend(); err != nil { |
| return nil, err |
| } |
| return x, nil |
| } |
| |
| type RouteGuide_ListFeaturesClient interface { |
| Recv() (*Feature, error) |
| grpc.ClientStream |
| } |
| |
| type routeGuideListFeaturesClient struct { |
| grpc.ClientStream |
| } |
| |
| func (x *routeGuideListFeaturesClient) Recv() (*Feature, error) { |
| m := new(Feature) |
| if err := x.ClientStream.RecvMsg(m); err != nil { |
| return nil, err |
| } |
| return m, nil |
| } |
| |
| func (c *routeGuideClient) RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error) { |
| stream, err := c.cc.NewStream(ctx, &_RouteGuide_serviceDesc.Streams[1], "/routeguide.RouteGuide/RecordRoute", opts...) |
| if err != nil { |
| return nil, err |
| } |
| x := &routeGuideRecordRouteClient{stream} |
| return x, nil |
| } |
| |
| type RouteGuide_RecordRouteClient interface { |
| Send(*Point) error |
| CloseAndRecv() (*RouteSummary, error) |
| grpc.ClientStream |
| } |
| |
| type routeGuideRecordRouteClient struct { |
| grpc.ClientStream |
| } |
| |
| func (x *routeGuideRecordRouteClient) Send(m *Point) error { |
| return x.ClientStream.SendMsg(m) |
| } |
| |
| func (x *routeGuideRecordRouteClient) CloseAndRecv() (*RouteSummary, error) { |
| if err := x.ClientStream.CloseSend(); err != nil { |
| return nil, err |
| } |
| m := new(RouteSummary) |
| if err := x.ClientStream.RecvMsg(m); err != nil { |
| return nil, err |
| } |
| return m, nil |
| } |
| |
| func (c *routeGuideClient) RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error) { |
| stream, err := c.cc.NewStream(ctx, &_RouteGuide_serviceDesc.Streams[2], "/routeguide.RouteGuide/RouteChat", opts...) |
| if err != nil { |
| return nil, err |
| } |
| x := &routeGuideRouteChatClient{stream} |
| return x, nil |
| } |
| |
| type RouteGuide_RouteChatClient interface { |
| Send(*RouteNote) error |
| Recv() (*RouteNote, error) |
| grpc.ClientStream |
| } |
| |
| type routeGuideRouteChatClient struct { |
| grpc.ClientStream |
| } |
| |
| func (x *routeGuideRouteChatClient) Send(m *RouteNote) error { |
| return x.ClientStream.SendMsg(m) |
| } |
| |
| func (x *routeGuideRouteChatClient) Recv() (*RouteNote, error) { |
| m := new(RouteNote) |
| if err := x.ClientStream.RecvMsg(m); err != nil { |
| return nil, err |
| } |
| return m, nil |
| } |
| |
| // RouteGuideServer is the server API for RouteGuide service. |
| type RouteGuideServer interface { |
| // A simple RPC. |
| // |
| // Obtains the feature at a given position. |
| // |
| // A feature with an empty name is returned if there's no feature at the given |
| // position. |
| GetFeature(context.Context, *Point) (*Feature, error) |
| // 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. |
| ListFeatures(*Rectangle, RouteGuide_ListFeaturesServer) error |
| // A client-to-server streaming RPC. |
| // |
| // Accepts a stream of Points on a route being traversed, returning a |
| // RouteSummary when traversal is completed. |
| RecordRoute(RouteGuide_RecordRouteServer) error |
| // 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). |
| RouteChat(RouteGuide_RouteChatServer) error |
| } |
| |
| // UnimplementedRouteGuideServer can be embedded to have forward compatible implementations. |
| type UnimplementedRouteGuideServer struct { |
| } |
| |
| func (*UnimplementedRouteGuideServer) GetFeature(ctx context.Context, req *Point) (*Feature, error) { |
| return nil, status.Errorf(codes.Unimplemented, "method GetFeature not implemented") |
| } |
| func (*UnimplementedRouteGuideServer) ListFeatures(req *Rectangle, srv RouteGuide_ListFeaturesServer) error { |
| return status.Errorf(codes.Unimplemented, "method ListFeatures not implemented") |
| } |
| func (*UnimplementedRouteGuideServer) RecordRoute(srv RouteGuide_RecordRouteServer) error { |
| return status.Errorf(codes.Unimplemented, "method RecordRoute not implemented") |
| } |
| func (*UnimplementedRouteGuideServer) RouteChat(srv RouteGuide_RouteChatServer) error { |
| return status.Errorf(codes.Unimplemented, "method RouteChat not implemented") |
| } |
| |
| func RegisterRouteGuideServer(s *grpc.Server, srv RouteGuideServer) { |
| s.RegisterService(&_RouteGuide_serviceDesc, srv) |
| } |
| |
| func _RouteGuide_GetFeature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(Point) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| if interceptor == nil { |
| return srv.(RouteGuideServer).GetFeature(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: "/routeguide.RouteGuide/GetFeature", |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(RouteGuideServer).GetFeature(ctx, req.(*Point)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| func _RouteGuide_ListFeatures_Handler(srv interface{}, stream grpc.ServerStream) error { |
| m := new(Rectangle) |
| if err := stream.RecvMsg(m); err != nil { |
| return err |
| } |
| return srv.(RouteGuideServer).ListFeatures(m, &routeGuideListFeaturesServer{stream}) |
| } |
| |
| type RouteGuide_ListFeaturesServer interface { |
| Send(*Feature) error |
| grpc.ServerStream |
| } |
| |
| type routeGuideListFeaturesServer struct { |
| grpc.ServerStream |
| } |
| |
| func (x *routeGuideListFeaturesServer) Send(m *Feature) error { |
| return x.ServerStream.SendMsg(m) |
| } |
| |
| func _RouteGuide_RecordRoute_Handler(srv interface{}, stream grpc.ServerStream) error { |
| return srv.(RouteGuideServer).RecordRoute(&routeGuideRecordRouteServer{stream}) |
| } |
| |
| type RouteGuide_RecordRouteServer interface { |
| SendAndClose(*RouteSummary) error |
| Recv() (*Point, error) |
| grpc.ServerStream |
| } |
| |
| type routeGuideRecordRouteServer struct { |
| grpc.ServerStream |
| } |
| |
| func (x *routeGuideRecordRouteServer) SendAndClose(m *RouteSummary) error { |
| return x.ServerStream.SendMsg(m) |
| } |
| |
| func (x *routeGuideRecordRouteServer) Recv() (*Point, error) { |
| m := new(Point) |
| if err := x.ServerStream.RecvMsg(m); err != nil { |
| return nil, err |
| } |
| return m, nil |
| } |
| |
| func _RouteGuide_RouteChat_Handler(srv interface{}, stream grpc.ServerStream) error { |
| return srv.(RouteGuideServer).RouteChat(&routeGuideRouteChatServer{stream}) |
| } |
| |
| type RouteGuide_RouteChatServer interface { |
| Send(*RouteNote) error |
| Recv() (*RouteNote, error) |
| grpc.ServerStream |
| } |
| |
| type routeGuideRouteChatServer struct { |
| grpc.ServerStream |
| } |
| |
| func (x *routeGuideRouteChatServer) Send(m *RouteNote) error { |
| return x.ServerStream.SendMsg(m) |
| } |
| |
| func (x *routeGuideRouteChatServer) Recv() (*RouteNote, error) { |
| m := new(RouteNote) |
| if err := x.ServerStream.RecvMsg(m); err != nil { |
| return nil, err |
| } |
| return m, nil |
| } |
| |
| var _RouteGuide_serviceDesc = grpc.ServiceDesc{ |
| ServiceName: "routeguide.RouteGuide", |
| HandlerType: (*RouteGuideServer)(nil), |
| Methods: []grpc.MethodDesc{ |
| { |
| MethodName: "GetFeature", |
| Handler: _RouteGuide_GetFeature_Handler, |
| }, |
| }, |
| Streams: []grpc.StreamDesc{ |
| { |
| StreamName: "ListFeatures", |
| Handler: _RouteGuide_ListFeatures_Handler, |
| ServerStreams: true, |
| }, |
| { |
| StreamName: "RecordRoute", |
| Handler: _RouteGuide_RecordRoute_Handler, |
| ClientStreams: true, |
| }, |
| { |
| StreamName: "RouteChat", |
| Handler: _RouteGuide_RouteChat_Handler, |
| ServerStreams: true, |
| ClientStreams: true, |
| }, |
| }, |
| Metadata: "routeguide.proto", |
| } |
| |
| // RouteGuideClientImpl is the client API for RouteGuide service. |
| // |
| // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. |
| type RouteGuideClientImpl struct { |
| // A simple RPC. |
| // |
| // Obtains the feature at a given position. |
| // |
| // A feature with an empty name is returned if there's no feature at the given |
| // position. |
| GetFeature func(ctx context.Context, in *Point, out *Feature) error |
| // 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. |
| ListFeatures func(ctx context.Context, in *Rectangle) (RouteGuide_ListFeaturesClient, error) |
| // A client-to-server streaming RPC. |
| // |
| // Accepts a stream of Points on a route being traversed, returning a |
| // RouteSummary when traversal is completed. |
| RecordRoute func(ctx context.Context) (RouteGuide_RecordRouteClient, error) |
| // 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). |
| RouteChat func(ctx context.Context) (RouteGuide_RouteChatClient, error) |
| } |
| |
| func (c *RouteGuideClientImpl) Reference() string { |
| return "routeGuideImpl" |
| } |
| |
| func (c *RouteGuideClientImpl) GetDubboStub(cc *grpc.ClientConn) RouteGuideClient { |
| return NewRouteGuideClient(cc) |
| } |
| |
| type RouteGuideProviderBase struct { |
| proxyImpl protocol.Invoker |
| } |
| |
| func (s *RouteGuideProviderBase) SetProxyImpl(impl protocol.Invoker) { |
| s.proxyImpl = impl |
| } |
| |
| func (s *RouteGuideProviderBase) GetProxyImpl() protocol.Invoker { |
| return s.proxyImpl |
| } |
| |
| func (c *RouteGuideProviderBase) Reference() string { |
| return "routeGuideImpl" |
| } |
| |
| func _DUBBO_RouteGuide_GetFeature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(Point) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| // DubboGrpcService is gRPC service |
| type DubboGrpcService interface { |
| // SetProxyImpl sets proxy. |
| SetProxyImpl(impl protocol.Invoker) |
| // GetProxyImpl gets proxy. |
| GetProxyImpl() protocol.Invoker |
| // ServiceDesc gets an RPC service's specification. |
| ServiceDesc() *grpc.ServiceDesc |
| } |
| base := srv.(DubboGrpcService) |
| args := []interface{}{} |
| args = append(args, in) |
| invo := invocation.NewRPCInvocation("GetFeature", args, nil) |
| if interceptor == nil { |
| result := base.GetProxyImpl().Invoke(ctx, invo) |
| return result.Result(), result.Error() |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: "/routeguide.RouteGuide/GetFeature", |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| result := base.GetProxyImpl().Invoke(ctx, invo) |
| return result.Result(), result.Error() |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| func _DUBBO_RouteGuide_ListFeatures_Handler(srv interface{}, stream grpc.ServerStream) error { |
| // DubboGrpcService is gRPC service |
| type DubboGrpcService interface { |
| // SetProxyImpl sets proxy. |
| SetProxyImpl(impl protocol.Invoker) |
| // GetProxyImpl gets proxy. |
| GetProxyImpl() protocol.Invoker |
| // ServiceDesc gets an RPC service's specification. |
| ServiceDesc() *grpc.ServiceDesc |
| } |
| _, ok := srv.(DubboGrpcService) |
| invo := invocation.NewRPCInvocation("ListFeatures", nil, nil) |
| if !ok { |
| fmt.Println(invo) |
| } |
| m := new(Rectangle) |
| if err := stream.RecvMsg(m); err != nil { |
| return err |
| } |
| return srv.(RouteGuideServer).ListFeatures(m, &routeGuideListFeaturesServer{stream}) |
| } |
| |
| func _DUBBO_RouteGuide_RecordRoute_Handler(srv interface{}, stream grpc.ServerStream) error { |
| // DubboGrpcService is gRPC service |
| type DubboGrpcService interface { |
| // SetProxyImpl sets proxy. |
| SetProxyImpl(impl protocol.Invoker) |
| // GetProxyImpl gets proxy. |
| GetProxyImpl() protocol.Invoker |
| // ServiceDesc gets an RPC service's specification. |
| ServiceDesc() *grpc.ServiceDesc |
| } |
| _, ok := srv.(DubboGrpcService) |
| invo := invocation.NewRPCInvocation("RecordRoute", nil, nil) |
| if !ok { |
| fmt.Println(invo) |
| } |
| return srv.(RouteGuideServer).RecordRoute(&routeGuideRecordRouteServer{stream}) |
| } |
| |
| func _DUBBO_RouteGuide_RouteChat_Handler(srv interface{}, stream grpc.ServerStream) error { |
| // DubboGrpcService is gRPC service |
| type DubboGrpcService interface { |
| // SetProxyImpl sets proxy. |
| SetProxyImpl(impl protocol.Invoker) |
| // GetProxyImpl gets proxy. |
| GetProxyImpl() protocol.Invoker |
| // ServiceDesc gets an RPC service's specification. |
| ServiceDesc() *grpc.ServiceDesc |
| } |
| _, ok := srv.(DubboGrpcService) |
| invo := invocation.NewRPCInvocation("RouteChat", nil, nil) |
| if !ok { |
| fmt.Println(invo) |
| } |
| return srv.(RouteGuideServer).RouteChat(&routeGuideRouteChatServer{stream}) |
| } |
| |
| func (s *RouteGuideProviderBase) ServiceDesc() *grpc.ServiceDesc { |
| return &grpc.ServiceDesc{ |
| ServiceName: "routeguide.RouteGuide", |
| HandlerType: (*RouteGuideServer)(nil), |
| Methods: []grpc.MethodDesc{ |
| { |
| MethodName: "GetFeature", |
| Handler: _DUBBO_RouteGuide_GetFeature_Handler, |
| }, |
| }, |
| Streams: []grpc.StreamDesc{ |
| { |
| StreamName: "ListFeatures", |
| Handler: _DUBBO_RouteGuide_ListFeatures_Handler, |
| ServerStreams: true, |
| }, |
| { |
| StreamName: "RecordRoute", |
| Handler: _DUBBO_RouteGuide_RecordRoute_Handler, |
| ClientStreams: true, |
| }, |
| { |
| StreamName: "RouteChat", |
| Handler: _DUBBO_RouteGuide_RouteChat_Handler, |
| ServerStreams: true, |
| ClientStreams: true, |
| }, |
| }, |
| Metadata: "routeguide.proto", |
| } |
| } |