routeguide

package
v0.0.0-...-d79db7e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthRouteGuide = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRouteGuide   = 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,proto3" 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) Descriptor() ([]byte, []int)

func (*Feature) Equal

func (this *Feature) Equal(that interface{}) bool

func (*Feature) GetLocation

func (m *Feature) GetLocation() *Point

func (*Feature) GetName

func (m *Feature) GetName() string

func (*Feature) GoString

func (this *Feature) GoString() string

func (*Feature) Marshal

func (m *Feature) Marshal() (dAtA []byte, err error)

func (*Feature) MarshalTo

func (m *Feature) MarshalTo(dAtA []byte) (int, error)

func (*Feature) ProtoMessage

func (*Feature) ProtoMessage()

func (*Feature) Reset

func (m *Feature) Reset()

func (*Feature) Size

func (m *Feature) Size() (n int)

func (*Feature) String

func (this *Feature) String() string

func (*Feature) Unmarshal

func (m *Feature) Unmarshal(dAtA []byte) error

func (*Feature) XXX_DiscardUnknown

func (m *Feature) XXX_DiscardUnknown()

func (*Feature) XXX_Marshal

func (m *Feature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Feature) XXX_Merge

func (m *Feature) XXX_Merge(src proto.Message)

func (*Feature) XXX_Size

func (m *Feature) XXX_Size() int

func (*Feature) XXX_Unmarshal

func (m *Feature) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*Point) Equal

func (this *Point) Equal(that interface{}) bool

func (*Point) GetLatitude

func (m *Point) GetLatitude() int32

func (*Point) GetLongitude

func (m *Point) GetLongitude() int32

func (*Point) GoString

func (this *Point) GoString() string

func (*Point) Marshal

func (m *Point) Marshal() (dAtA []byte, err error)

func (*Point) MarshalTo

func (m *Point) MarshalTo(dAtA []byte) (int, error)

func (*Point) ProtoMessage

func (*Point) ProtoMessage()

func (*Point) Reset

func (m *Point) Reset()

func (*Point) Size

func (m *Point) Size() (n int)

func (*Point) String

func (this *Point) String() string

func (*Point) Unmarshal

func (m *Point) Unmarshal(dAtA []byte) error

func (*Point) XXX_DiscardUnknown

func (m *Point) XXX_DiscardUnknown()

func (*Point) XXX_Marshal

func (m *Point) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Point) XXX_Merge

func (m *Point) XXX_Merge(src proto.Message)

func (*Point) XXX_Size

func (m *Point) XXX_Size() int

func (*Point) XXX_Unmarshal

func (m *Point) XXX_Unmarshal(b []byte) error

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"`
}

A latitude-longitude rectangle, represented as two diagonally opposite points "lo" and "hi".

func (*Rectangle) Descriptor

func (*Rectangle) Descriptor() ([]byte, []int)

func (*Rectangle) Equal

func (this *Rectangle) Equal(that interface{}) bool

func (*Rectangle) GetHi

func (m *Rectangle) GetHi() *Point

func (*Rectangle) GetLo

func (m *Rectangle) GetLo() *Point

func (*Rectangle) GoString

func (this *Rectangle) GoString() string

func (*Rectangle) Marshal

func (m *Rectangle) Marshal() (dAtA []byte, err error)

func (*Rectangle) MarshalTo

func (m *Rectangle) MarshalTo(dAtA []byte) (int, error)

func (*Rectangle) ProtoMessage

func (*Rectangle) ProtoMessage()

func (*Rectangle) Reset

func (m *Rectangle) Reset()

func (*Rectangle) Size

func (m *Rectangle) Size() (n int)

func (*Rectangle) String

func (this *Rectangle) String() string

func (*Rectangle) Unmarshal

func (m *Rectangle) Unmarshal(dAtA []byte) error

func (*Rectangle) XXX_DiscardUnknown

func (m *Rectangle) XXX_DiscardUnknown()

func (*Rectangle) XXX_Marshal

func (m *Rectangle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Rectangle) XXX_Merge

func (m *Rectangle) XXX_Merge(src proto.Message)

func (*Rectangle) XXX_Size

func (m *Rectangle) XXX_Size() int

func (*Rectangle) XXX_Unmarshal

func (m *Rectangle) XXX_Unmarshal(b []byte) error

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)
}

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.

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
}

RouteGuideServer is the server API for RouteGuide service.

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 RouteGuide_RouteChatClient

type RouteGuide_RouteChatClient interface {
	Send(*RouteNote) error
	Recv() (*RouteNote, error)
	grpc.ClientStream
}

type RouteGuide_RouteChatServer

type RouteGuide_RouteChatServer interface {
	Send(*RouteNote) error
	Recv() (*RouteNote, 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"`
}

A RouteNote is a message sent while at a given point.

func (*RouteNote) Descriptor

func (*RouteNote) Descriptor() ([]byte, []int)

func (*RouteNote) Equal

func (this *RouteNote) Equal(that interface{}) bool

func (*RouteNote) GetLocation

func (m *RouteNote) GetLocation() *Point

func (*RouteNote) GetMessage

func (m *RouteNote) GetMessage() string

func (*RouteNote) GoString

func (this *RouteNote) GoString() string

func (*RouteNote) Marshal

func (m *RouteNote) Marshal() (dAtA []byte, err error)

func (*RouteNote) MarshalTo

func (m *RouteNote) MarshalTo(dAtA []byte) (int, error)

func (*RouteNote) ProtoMessage

func (*RouteNote) ProtoMessage()

func (*RouteNote) Reset

func (m *RouteNote) Reset()

func (*RouteNote) Size

func (m *RouteNote) Size() (n int)

func (*RouteNote) String

func (this *RouteNote) String() string

func (*RouteNote) Unmarshal

func (m *RouteNote) Unmarshal(dAtA []byte) error

func (*RouteNote) XXX_DiscardUnknown

func (m *RouteNote) XXX_DiscardUnknown()

func (*RouteNote) XXX_Marshal

func (m *RouteNote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RouteNote) XXX_Merge

func (m *RouteNote) XXX_Merge(src proto.Message)

func (*RouteNote) XXX_Size

func (m *RouteNote) XXX_Size() int

func (*RouteNote) XXX_Unmarshal

func (m *RouteNote) XXX_Unmarshal(b []byte) error

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) Equal

func (this *RouteSummary) Equal(that interface{}) bool

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) GoString

func (this *RouteSummary) GoString() string

func (*RouteSummary) Marshal

func (m *RouteSummary) Marshal() (dAtA []byte, err error)

func (*RouteSummary) MarshalTo

func (m *RouteSummary) MarshalTo(dAtA []byte) (int, 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

func (*RouteSummary) XXX_DiscardUnknown

func (m *RouteSummary) XXX_DiscardUnknown()

func (*RouteSummary) XXX_Marshal

func (m *RouteSummary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RouteSummary) XXX_Merge

func (m *RouteSummary) XXX_Merge(src proto.Message)

func (*RouteSummary) XXX_Size

func (m *RouteSummary) XXX_Size() int

func (*RouteSummary) XXX_Unmarshal

func (m *RouteSummary) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL