Documentation ¶
Overview ¶
Package test is a generated protocol buffer package.
It is generated from these files:
service.proto
It has these top-level messages:
Point Rectangle Feature RouteNote RouteSummary
Index ¶
- Variables
- func RegisterRouteGuideServer(s *grpc.Server, srv RouteGuideServer)
- type Feature
- func (*Feature) Descriptor() ([]byte, []int)
- func (this *Feature) GoString() string
- func (m *Feature) Marshal() (data []byte, err error)
- func (m *Feature) MarshalTo(data []byte) (int, error)
- func (*Feature) ProtoMessage()
- func (m *Feature) Reset()
- func (m *Feature) Size() (n int)
- func (this *Feature) String() string
- func (m *Feature) Unmarshal(data []byte) error
- type Point
- func (*Point) Descriptor() ([]byte, []int)
- func (this *Point) GoString() string
- func (m *Point) Marshal() (data []byte, err error)
- func (m *Point) MarshalTo(data []byte) (int, error)
- func (*Point) ProtoMessage()
- func (m *Point) Reset()
- func (m *Point) Size() (n int)
- func (this *Point) String() string
- func (m *Point) Unmarshal(data []byte) error
- type Rectangle
- func (*Rectangle) Descriptor() ([]byte, []int)
- func (this *Rectangle) GoString() string
- func (m *Rectangle) Marshal() (data []byte, err error)
- func (m *Rectangle) MarshalTo(data []byte) (int, error)
- func (*Rectangle) ProtoMessage()
- func (m *Rectangle) Reset()
- func (m *Rectangle) Size() (n int)
- func (this *Rectangle) String() string
- func (m *Rectangle) Unmarshal(data []byte) error
- type RouteGuideClient
- type RouteGuideServer
- type RouteGuide_ListFeaturesClient
- type RouteGuide_ListFeaturesServer
- type RouteGuide_RecordRouteClient
- type RouteGuide_RecordRouteServer
- type RouteGuide_RouteChatClient
- type RouteGuide_RouteChatServer
- type RouteNote
- func (*RouteNote) Descriptor() ([]byte, []int)
- func (this *RouteNote) GoString() string
- func (m *RouteNote) Marshal() (data []byte, err error)
- func (m *RouteNote) MarshalTo(data []byte) (int, error)
- func (*RouteNote) ProtoMessage()
- func (m *RouteNote) Reset()
- func (m *RouteNote) Size() (n int)
- func (this *RouteNote) String() string
- func (m *RouteNote) Unmarshal(data []byte) error
- type RouteSummary
- func (*RouteSummary) Descriptor() ([]byte, []int)
- func (this *RouteSummary) GoString() string
- func (m *RouteSummary) Marshal() (data []byte, err error)
- func (m *RouteSummary) MarshalTo(data []byte) (int, error)
- func (*RouteSummary) ProtoMessage()
- func (m *RouteSummary) Reset()
- func (m *RouteSummary) Size() (n int)
- func (this *RouteSummary) String() string
- func (m *RouteSummary) Unmarshal(data []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthService = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowService = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RegisterRouteGuideServer ¶
func RegisterRouteGuideServer(s *grpc.Server, 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 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) ProtoMessage ¶
func (*Feature) ProtoMessage()
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"` }
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 ¶
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 RouteGuideClient ¶
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) }
func NewRouteGuideClient ¶
func NewRouteGuideClient(cc *grpc.ClientConn) RouteGuideClient
type RouteGuideServer ¶
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 }
func NewRaftProxyRouteGuideServer ¶
func NewRaftProxyRouteGuideServer(local RouteGuideServer, connSelector *raftpicker.ConnSelector, cluster raftpicker.RaftCluster, ctxMod func(context.Context) (context.Context, error)) RouteGuideServer
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" json:"location,omitempty"` // The message to be sent. Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` }
A RouteNote is a message sent while at a given point.
func (*RouteNote) Descriptor ¶
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,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 metres. 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"` }
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) GoString ¶
func (this *RouteSummary) GoString() string
func (*RouteSummary) Marshal ¶
func (m *RouteSummary) Marshal() (data []byte, err error)
func (*RouteSummary) ProtoMessage ¶
func (*RouteSummary) ProtoMessage()
func (*RouteSummary) Reset ¶
func (m *RouteSummary) Reset()
func (*RouteSummary) Size ¶
func (m *RouteSummary) Size() (n int)
func (*RouteSummary) String ¶
func (this *RouteSummary) String() string
func (*RouteSummary) Unmarshal ¶
func (m *RouteSummary) Unmarshal(data []byte) error