Documentation
¶
Overview ¶
Package myrouteapp is a generated protocol buffer package.
It is generated from these files:
myroute.proto
It has these top-level messages:
Point Rectangle Feature RouteNote RouteSummary
Index ¶
- func RegisterMyRouteGuideServer(s *grpc.Server, srv MyRouteGuideServer)
- type Feature
- type MyRouteGuideClient
- type MyRouteGuideServer
- type MyRouteGuide_ListFeaturesClient
- type MyRouteGuide_ListFeaturesServer
- type MyRouteGuide_RecordRouteClient
- type MyRouteGuide_RecordRouteServer
- type MyRouteGuide_RouteChatClient
- type MyRouteGuide_RouteChatServer
- type Point
- type Rectangle
- type RouteNote
- type RouteSummary
- func (*RouteSummary) Descriptor() ([]byte, []int)
- func (m *RouteSummary) GetDistance() int32
- func (m *RouteSummary) GetElapsedTime() int32
- func (m *RouteSummary) GetFeatureCount() int32
- func (m *RouteSummary) GetPointCount() int32
- func (*RouteSummary) ProtoMessage()
- func (m *RouteSummary) Reset()
- func (m *RouteSummary) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterMyRouteGuideServer ¶
func RegisterMyRouteGuideServer(s *grpc.Server, srv MyRouteGuideServer)
Types ¶
type Feature ¶
type Feature struct { // The name of the feature. Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // The point where the feature is detected. Location *Point `protobuf:"bytes,2,opt,name=location" json:"location,omitempty"` }
A feature names something at a given point.
If a feature could not be named, the name is empty.
func (*Feature) Descriptor ¶
func (*Feature) GetLocation ¶
func (*Feature) ProtoMessage ¶
func (*Feature) ProtoMessage()
type MyRouteGuideClient ¶
type MyRouteGuideClient interface { GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) // Stream it back as it may be a lot of items .. ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (MyRouteGuide_ListFeaturesClient, error) // Send over the many points RecordRoute(ctx context.Context, opts ...grpc.CallOption) (MyRouteGuide_RecordRouteClient, error) // RouteNotes send from one to another .. RouteChat(ctx context.Context, opts ...grpc.CallOption) (MyRouteGuide_RouteChatClient, error) }
func NewMyRouteGuideClient ¶
func NewMyRouteGuideClient(cc *grpc.ClientConn) MyRouteGuideClient
type MyRouteGuideServer ¶
type MyRouteGuideServer interface { GetFeature(context.Context, *Point) (*Feature, error) // Stream it back as it may be a lot of items .. ListFeatures(*Rectangle, MyRouteGuide_ListFeaturesServer) error // Send over the many points RecordRoute(MyRouteGuide_RecordRouteServer) error // RouteNotes send from one to another .. RouteChat(MyRouteGuide_RouteChatServer) error }
type MyRouteGuide_ListFeaturesClient ¶
type MyRouteGuide_ListFeaturesClient interface { Recv() (*Feature, error) grpc.ClientStream }
type MyRouteGuide_ListFeaturesServer ¶
type MyRouteGuide_ListFeaturesServer interface { Send(*Feature) error grpc.ServerStream }
type MyRouteGuide_RecordRouteClient ¶
type MyRouteGuide_RecordRouteClient interface { Send(*Point) error CloseAndRecv() (*RouteSummary, error) grpc.ClientStream }
type MyRouteGuide_RecordRouteServer ¶
type MyRouteGuide_RecordRouteServer interface { SendAndClose(*RouteSummary) error Recv() (*Point, error) grpc.ServerStream }
type Point ¶
type Point struct { Lat int32 `protobuf:"varint,1,opt,name=lat" json:"lat,omitempty"` Lng int32 `protobuf:"varint,2,opt,name=lng" json:"lng,omitempty"` }
func (*Point) Descriptor ¶
func (*Point) ProtoMessage ¶
func (*Point) ProtoMessage()
type Rectangle ¶
type Rectangle struct { // One corner of the rectangle. Lo *Point `protobuf:"bytes,1,opt,name=lo" json:"lo,omitempty"` // The other corner of the rectangle. Hi *Point `protobuf:"bytes,2,opt,name=hi" json:"hi,omitempty"` }
A latitude-longitude rectangle, represented as two diagonally opposite points "lo" and "hi".
func (*Rectangle) Descriptor ¶
func (*Rectangle) ProtoMessage ¶
func (*Rectangle) ProtoMessage()
type RouteNote ¶
type RouteNote struct { // The location from which the message is sent. Location *Point `protobuf:"bytes,1,opt,name=location" json:"location,omitempty"` // The message to be sent. Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` }
A RouteNote is a message sent while at a given point.
func (*RouteNote) Descriptor ¶
func (*RouteNote) GetLocation ¶
func (*RouteNote) GetMessage ¶
func (*RouteNote) ProtoMessage ¶
func (*RouteNote) ProtoMessage()
type RouteSummary ¶
type RouteSummary struct { // The number of points received. PointCount int32 `protobuf:"varint,1,opt,name=point_count,json=pointCount" 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" json:"feature_count,omitempty"` // The distance covered in metres. Distance int32 `protobuf:"varint,3,opt,name=distance" json:"distance,omitempty"` // The duration of the traversal in seconds. ElapsedTime int32 `protobuf:"varint,4,opt,name=elapsed_time,json=elapsedTime" json:"elapsed_time,omitempty"` }
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.
func (*RouteSummary) Descriptor ¶
func (*RouteSummary) Descriptor() ([]byte, []int)
func (*RouteSummary) GetDistance ¶
func (m *RouteSummary) GetDistance() int32
func (*RouteSummary) GetElapsedTime ¶
func (m *RouteSummary) GetElapsedTime() int32
func (*RouteSummary) GetFeatureCount ¶
func (m *RouteSummary) GetFeatureCount() int32
func (*RouteSummary) GetPointCount ¶
func (m *RouteSummary) GetPointCount() int32
func (*RouteSummary) ProtoMessage ¶
func (*RouteSummary) ProtoMessage()
func (*RouteSummary) Reset ¶
func (m *RouteSummary) Reset()
func (*RouteSummary) String ¶
func (m *RouteSummary) String() string
Click to show internal directories.
Click to hide internal directories.