Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterRouteGuideServer(s grpc.ServiceRegistrar, srv RouteGuideServer)
- type Feature
- type Point
- type Rectangle
- type RouteGuideClient
- type RouteGuideServer
- type RouteGuide_ListFeaturesClient
- type RouteGuide_ListFeaturesServer
- type RouteGuide_RecordRouteClient
- type RouteGuide_RecordRouteServer
- type RouteGuide_RouteChatClient
- type RouteGuide_RouteChatServer
- type RouteNote
- type RouteSummary
- func (*RouteSummary) Descriptor() ([]byte, []int)deprecated
- func (x *RouteSummary) GetDistanceCovered() int32
- func (x *RouteSummary) GetFeatureCount() int32
- func (x *RouteSummary) GetPointCount() int32
- func (x *RouteSummary) GetTimeElapsed() int32
- func (*RouteSummary) ProtoMessage()
- func (x *RouteSummary) ProtoReflect() protoreflect.Message
- func (x *RouteSummary) Reset()
- func (x *RouteSummary) String() string
- type UnimplementedRouteGuideServer
- func (UnimplementedRouteGuideServer) GetFeature(context.Context, *Point) (*Feature, error)
- func (UnimplementedRouteGuideServer) ListFeatures(*Rectangle, RouteGuide_ListFeaturesServer) error
- func (UnimplementedRouteGuideServer) RecordRoute(RouteGuide_RecordRouteServer) error
- func (UnimplementedRouteGuideServer) RouteChat(RouteGuide_RouteChatServer) error
- type UnsafeRouteGuideServer
Constants ¶
const ( RouteGuide_GetFeature_FullMethodName = "/routeguide.RouteGuide/GetFeature" RouteGuide_ListFeatures_FullMethodName = "/routeguide.RouteGuide/ListFeatures" RouteGuide_RecordRoute_FullMethodName = "/routeguide.RouteGuide/RecordRoute" RouteGuide_RouteChat_FullMethodName = "/routeguide.RouteGuide/RouteChat" )
Variables ¶
var File_route_guide_proto protoreflect.FileDescriptor
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: "route_guide.proto", }
RouteGuide_ServiceDesc is the grpc.ServiceDesc for RouteGuide service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRouteGuideServer ¶
func RegisterRouteGuideServer(s grpc.ServiceRegistrar, srv RouteGuideServer)
Types ¶
type Feature ¶
type Feature struct { // The name of the feature. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The location of the feature. Location *Point `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"` // contains filtered or unexported fields }
Some intrresting feature located at a point.
func (*Feature) Descriptor
deprecated
func (*Feature) GetLocation ¶
func (*Feature) ProtoMessage ¶
func (*Feature) ProtoMessage()
func (*Feature) ProtoReflect ¶
func (x *Feature) ProtoReflect() protoreflect.Message
type Point ¶
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"` // contains filtered or unexported fields }
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).
func (*Point) Descriptor
deprecated
func (*Point) GetLatitude ¶
func (*Point) GetLongitude ¶
func (*Point) ProtoMessage ¶
func (*Point) ProtoMessage()
func (*Point) ProtoReflect ¶
func (x *Point) ProtoReflect() protoreflect.Message
type Rectangle ¶
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"` // contains filtered or unexported fields }
A rectangle represented by two diagonally opposite points.
func (*Rectangle) Descriptor
deprecated
func (*Rectangle) ProtoMessage ¶
func (*Rectangle) ProtoMessage()
func (*Rectangle) ProtoReflect ¶
func (x *Rectangle) ProtoReflect() protoreflect.Message
type RouteGuideClient ¶
type RouteGuideClient interface { // Obtains features at a given position. GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) // Streams the features that lie within the given rectangle. ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (RouteGuide_ListFeaturesClient, error) // Accepts a stream of points representing the route being traversed. // Returns a route summary when all the points are received. RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error) // Received a stream of notes and responds with a stream of notes for the // route being traversed. RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error) }
RouteGuideClient is the client API for RouteGuide service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewRouteGuideClient ¶
func NewRouteGuideClient(cc grpc.ClientConnInterface) RouteGuideClient
type RouteGuideServer ¶
type RouteGuideServer interface { // Obtains features at a given position. GetFeature(context.Context, *Point) (*Feature, error) // Streams the features that lie within the given rectangle. ListFeatures(*Rectangle, RouteGuide_ListFeaturesServer) error // Accepts a stream of points representing the route being traversed. // Returns a route summary when all the points are received. RecordRoute(RouteGuide_RecordRouteServer) error // Received a stream of notes and responds with a stream of notes for the // route being traversed. RouteChat(RouteGuide_RouteChatServer) error // contains filtered or unexported methods }
RouteGuideServer is the server API for RouteGuide service. All implementations must embed UnimplementedRouteGuideServer for forward compatibility
type RouteGuide_ListFeaturesClient ¶
type RouteGuide_ListFeaturesClient interface { Recv() (*Feature, error) grpc.ClientStream }
type RouteGuide_ListFeaturesServer ¶
type RouteGuide_ListFeaturesServer interface { Send(*Feature) error grpc.ServerStream }
type RouteGuide_RecordRouteClient ¶
type RouteGuide_RecordRouteClient interface { Send(*Point) error CloseAndRecv() (*RouteSummary, error) grpc.ClientStream }
type RouteGuide_RecordRouteServer ¶
type RouteGuide_RecordRouteServer interface { SendAndClose(*RouteSummary) error Recv() (*Point, error) grpc.ServerStream }
type RouteNote ¶
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"` // contains filtered or unexported fields }
A message sent from a particular location.
func (*RouteNote) Descriptor
deprecated
func (*RouteNote) GetLocation ¶
func (*RouteNote) GetMessage ¶
func (*RouteNote) ProtoMessage ¶
func (*RouteNote) ProtoMessage()
func (*RouteNote) ProtoReflect ¶
func (x *RouteNote) ProtoReflect() protoreflect.Message
type RouteSummary ¶
type RouteSummary struct { // The number of features seen on the route. FeatureCount int32 `protobuf:"varint,1,opt,name=feature_count,json=featureCount,proto3" json:"feature_count,omitempty"` // The number of points on the route. PointCount int32 `protobuf:"varint,2,opt,name=point_count,json=pointCount,proto3" json:"point_count,omitempty"` // The distance covered in meters. DistanceCovered int32 `protobuf:"varint,3,opt,name=distance_covered,json=distanceCovered,proto3" json:"distance_covered,omitempty"` // The duration elapsed in seconds. TimeElapsed int32 `protobuf:"varint,4,opt,name=time_elapsed,json=timeElapsed,proto3" json:"time_elapsed,omitempty"` // contains filtered or unexported fields }
A summary of the route including the number of features, points, the distance convered and the time elapsed.
func (*RouteSummary) Descriptor
deprecated
func (*RouteSummary) Descriptor() ([]byte, []int)
Deprecated: Use RouteSummary.ProtoReflect.Descriptor instead.
func (*RouteSummary) GetDistanceCovered ¶
func (x *RouteSummary) GetDistanceCovered() int32
func (*RouteSummary) GetFeatureCount ¶
func (x *RouteSummary) GetFeatureCount() int32
func (*RouteSummary) GetPointCount ¶
func (x *RouteSummary) GetPointCount() int32
func (*RouteSummary) GetTimeElapsed ¶
func (x *RouteSummary) GetTimeElapsed() int32
func (*RouteSummary) ProtoMessage ¶
func (*RouteSummary) ProtoMessage()
func (*RouteSummary) ProtoReflect ¶
func (x *RouteSummary) ProtoReflect() protoreflect.Message
func (*RouteSummary) Reset ¶
func (x *RouteSummary) Reset()
func (*RouteSummary) String ¶
func (x *RouteSummary) String() string
type UnimplementedRouteGuideServer ¶
type UnimplementedRouteGuideServer struct { }
UnimplementedRouteGuideServer must be embedded to have forward compatible implementations.
func (UnimplementedRouteGuideServer) GetFeature ¶
func (UnimplementedRouteGuideServer) ListFeatures ¶
func (UnimplementedRouteGuideServer) ListFeatures(*Rectangle, RouteGuide_ListFeaturesServer) error
func (UnimplementedRouteGuideServer) RecordRoute ¶
func (UnimplementedRouteGuideServer) RecordRoute(RouteGuide_RecordRouteServer) error
func (UnimplementedRouteGuideServer) RouteChat ¶
func (UnimplementedRouteGuideServer) RouteChat(RouteGuide_RouteChatServer) error
type UnsafeRouteGuideServer ¶
type UnsafeRouteGuideServer interface {
// contains filtered or unexported methods
}
UnsafeRouteGuideServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RouteGuideServer will result in compilation errors.
Directories
¶
Path | Synopsis |
---|---|
Package main implements a gRPC client that interacts with a server running locally which hosts the route guide server.
|
Package main implements a gRPC client that interacts with a server running locally which hosts the route guide server. |
Package data provides convenience routines to access files in the data directory.
|
Package data provides convenience routines to access files in the data directory. |
A gRPC server that hosts the routeguide service.
|
A gRPC server that hosts the routeguide service. |