routeguidev1

package
v0.0.0-...-67e434f Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package routeguidev1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	RouteGuideService_GetFeature_FullMethodName   = "/routeguide.v1.RouteGuideService/GetFeature"
	RouteGuideService_ListFeatures_FullMethodName = "/routeguide.v1.RouteGuideService/ListFeatures"
	RouteGuideService_RecordRoute_FullMethodName  = "/routeguide.v1.RouteGuideService/RecordRoute"
	RouteGuideService_RouteChat_FullMethodName    = "/routeguide.v1.RouteGuideService/RouteChat"
)

Variables

View Source
var File_routeguide_v1_feature_proto protoreflect.FileDescriptor
View Source
var File_routeguide_v1_route_proto protoreflect.FileDescriptor
View Source
var File_routeguide_v1_routeguide_proto protoreflect.FileDescriptor
View Source
var RouteGuideService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "routeguide.v1.RouteGuideService",
	HandlerType: (*RouteGuideServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetFeature",
			Handler:    _RouteGuideService_GetFeature_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ListFeatures",
			Handler:       _RouteGuideService_ListFeatures_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "RecordRoute",
			Handler:       _RouteGuideService_RecordRoute_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "RouteChat",
			Handler:       _RouteGuideService_RouteChat_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "routeguide/v1/routeguide.proto",
}

RouteGuideService_ServiceDesc is the grpc.ServiceDesc for RouteGuideService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterRouteGuideServiceHandler

func RegisterRouteGuideServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterRouteGuideServiceHandler registers the http handlers for service RouteGuideService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterRouteGuideServiceHandlerClient

func RegisterRouteGuideServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RouteGuideServiceClient) error

RegisterRouteGuideServiceHandlerClient registers the http handlers for service RouteGuideService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RouteGuideServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RouteGuideServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "RouteGuideServiceClient" to call the correct interceptors.

func RegisterRouteGuideServiceHandlerFromEndpoint

func RegisterRouteGuideServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterRouteGuideServiceHandlerFromEndpoint is same as RegisterRouteGuideServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterRouteGuideServiceHandlerServer

func RegisterRouteGuideServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RouteGuideServiceServer) error

RegisterRouteGuideServiceHandlerServer registers the http handlers for service RouteGuideService to "mux". UnaryRPC :call RouteGuideServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRouteGuideServiceHandlerFromEndpoint instead.

func RegisterRouteGuideServiceServer

func RegisterRouteGuideServiceServer(s grpc.ServiceRegistrar, srv RouteGuideServiceServer)

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"`
	// contains filtered or unexported fields
}

A feature names something at a given point.

If a feature could not be named, the name is empty.

func (*Feature) Descriptor deprecated

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

Deprecated: Use Feature.ProtoReflect.Descriptor instead.

func (*Feature) GetLocation

func (x *Feature) GetLocation() *Point

func (*Feature) GetName

func (x *Feature) GetName() string

func (*Feature) ProtoMessage

func (*Feature) ProtoMessage()

func (*Feature) ProtoReflect

func (x *Feature) ProtoReflect() protoreflect.Message

func (*Feature) Reset

func (x *Feature) Reset()

func (*Feature) String

func (x *Feature) String() string

type GetFeatureRequest

type GetFeatureRequest struct {
	Point *Point `protobuf:"bytes,1,opt,name=point,proto3" json:"point,omitempty"`
	// contains filtered or unexported fields
}

func (*GetFeatureRequest) Descriptor deprecated

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

Deprecated: Use GetFeatureRequest.ProtoReflect.Descriptor instead.

func (*GetFeatureRequest) GetPoint

func (x *GetFeatureRequest) GetPoint() *Point

func (*GetFeatureRequest) ProtoMessage

func (*GetFeatureRequest) ProtoMessage()

func (*GetFeatureRequest) ProtoReflect

func (x *GetFeatureRequest) ProtoReflect() protoreflect.Message

func (*GetFeatureRequest) Reset

func (x *GetFeatureRequest) Reset()

func (*GetFeatureRequest) String

func (x *GetFeatureRequest) String() string

type GetFeatureResponse

type GetFeatureResponse struct {
	Feature *Feature `protobuf:"bytes,1,opt,name=feature,proto3" json:"feature,omitempty"`
	// contains filtered or unexported fields
}

func (*GetFeatureResponse) Descriptor deprecated

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

Deprecated: Use GetFeatureResponse.ProtoReflect.Descriptor instead.

func (*GetFeatureResponse) GetFeature

func (x *GetFeatureResponse) GetFeature() *Feature

func (*GetFeatureResponse) ProtoMessage

func (*GetFeatureResponse) ProtoMessage()

func (*GetFeatureResponse) ProtoReflect

func (x *GetFeatureResponse) ProtoReflect() protoreflect.Message

func (*GetFeatureResponse) Reset

func (x *GetFeatureResponse) Reset()

func (*GetFeatureResponse) String

func (x *GetFeatureResponse) String() string

type ListFeaturesRequest

type ListFeaturesRequest struct {
	SearchArea *Rectangle `protobuf:"bytes,1,opt,name=search_area,json=searchArea,proto3" json:"search_area,omitempty"`
	// contains filtered or unexported fields
}

func (*ListFeaturesRequest) Descriptor deprecated

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

Deprecated: Use ListFeaturesRequest.ProtoReflect.Descriptor instead.

func (*ListFeaturesRequest) GetSearchArea

func (x *ListFeaturesRequest) GetSearchArea() *Rectangle

func (*ListFeaturesRequest) ProtoMessage

func (*ListFeaturesRequest) ProtoMessage()

func (*ListFeaturesRequest) ProtoReflect

func (x *ListFeaturesRequest) ProtoReflect() protoreflect.Message

func (*ListFeaturesRequest) Reset

func (x *ListFeaturesRequest) Reset()

func (*ListFeaturesRequest) String

func (x *ListFeaturesRequest) String() string

type ListFeaturesResponse

type ListFeaturesResponse struct {
	Feature *Feature `protobuf:"bytes,1,opt,name=feature,proto3" json:"feature,omitempty"`
	// contains filtered or unexported fields
}

func (*ListFeaturesResponse) Descriptor deprecated

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

Deprecated: Use ListFeaturesResponse.ProtoReflect.Descriptor instead.

func (*ListFeaturesResponse) GetFeature

func (x *ListFeaturesResponse) GetFeature() *Feature

func (*ListFeaturesResponse) ProtoMessage

func (*ListFeaturesResponse) ProtoMessage()

func (*ListFeaturesResponse) ProtoReflect

func (x *ListFeaturesResponse) ProtoReflect() protoreflect.Message

func (*ListFeaturesResponse) Reset

func (x *ListFeaturesResponse) Reset()

func (*ListFeaturesResponse) String

func (x *ListFeaturesResponse) String() string

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

Deprecated: Use Point.ProtoReflect.Descriptor instead.

func (*Point) GetLatitude

func (x *Point) GetLatitude() int32

func (*Point) GetLongitude

func (x *Point) GetLongitude() int32

func (*Point) ProtoMessage

func (*Point) ProtoMessage()

func (*Point) ProtoReflect

func (x *Point) ProtoReflect() protoreflect.Message

func (*Point) Reset

func (x *Point) Reset()

func (*Point) String

func (x *Point) String() string

type RecordRouteRequest

type RecordRouteRequest struct {
	NewPoint *Point `protobuf:"bytes,1,opt,name=new_point,json=newPoint,proto3" json:"new_point,omitempty"`
	// contains filtered or unexported fields
}

func (*RecordRouteRequest) Descriptor deprecated

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

Deprecated: Use RecordRouteRequest.ProtoReflect.Descriptor instead.

func (*RecordRouteRequest) GetNewPoint

func (x *RecordRouteRequest) GetNewPoint() *Point

func (*RecordRouteRequest) ProtoMessage

func (*RecordRouteRequest) ProtoMessage()

func (*RecordRouteRequest) ProtoReflect

func (x *RecordRouteRequest) ProtoReflect() protoreflect.Message

func (*RecordRouteRequest) Reset

func (x *RecordRouteRequest) Reset()

func (*RecordRouteRequest) String

func (x *RecordRouteRequest) String() string

type RecordRouteResponse

type RecordRouteResponse struct {
	RouteSummary *RouteSummary `protobuf:"bytes,1,opt,name=route_summary,json=routeSummary,proto3" json:"route_summary,omitempty"`
	// contains filtered or unexported fields
}

func (*RecordRouteResponse) Descriptor deprecated

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

Deprecated: Use RecordRouteResponse.ProtoReflect.Descriptor instead.

func (*RecordRouteResponse) GetRouteSummary

func (x *RecordRouteResponse) GetRouteSummary() *RouteSummary

func (*RecordRouteResponse) ProtoMessage

func (*RecordRouteResponse) ProtoMessage()

func (*RecordRouteResponse) ProtoReflect

func (x *RecordRouteResponse) ProtoReflect() protoreflect.Message

func (*RecordRouteResponse) Reset

func (x *RecordRouteResponse) Reset()

func (*RecordRouteResponse) String

func (x *RecordRouteResponse) String() string

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 latitude-longitude rectangle, represented as two diagonally opposite points "lo" and "hi".

func (*Rectangle) Descriptor deprecated

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

Deprecated: Use Rectangle.ProtoReflect.Descriptor instead.

func (*Rectangle) GetHi

func (x *Rectangle) GetHi() *Point

func (*Rectangle) GetLo

func (x *Rectangle) GetLo() *Point

func (*Rectangle) ProtoMessage

func (*Rectangle) ProtoMessage()

func (*Rectangle) ProtoReflect

func (x *Rectangle) ProtoReflect() protoreflect.Message

func (*Rectangle) Reset

func (x *Rectangle) Reset()

func (*Rectangle) String

func (x *Rectangle) String() string

type RouteChatRequest

type RouteChatRequest struct {
	NewMessage *RouteNote `protobuf:"bytes,1,opt,name=new_message,json=newMessage,proto3" json:"new_message,omitempty"`
	// contains filtered or unexported fields
}

func (*RouteChatRequest) Descriptor deprecated

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

Deprecated: Use RouteChatRequest.ProtoReflect.Descriptor instead.

func (*RouteChatRequest) GetNewMessage

func (x *RouteChatRequest) GetNewMessage() *RouteNote

func (*RouteChatRequest) ProtoMessage

func (*RouteChatRequest) ProtoMessage()

func (*RouteChatRequest) ProtoReflect

func (x *RouteChatRequest) ProtoReflect() protoreflect.Message

func (*RouteChatRequest) Reset

func (x *RouteChatRequest) Reset()

func (*RouteChatRequest) String

func (x *RouteChatRequest) String() string

type RouteChatResponse

type RouteChatResponse struct {
	Message *RouteNote `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*RouteChatResponse) Descriptor deprecated

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

Deprecated: Use RouteChatResponse.ProtoReflect.Descriptor instead.

func (*RouteChatResponse) GetMessage

func (x *RouteChatResponse) GetMessage() *RouteNote

func (*RouteChatResponse) ProtoMessage

func (*RouteChatResponse) ProtoMessage()

func (*RouteChatResponse) ProtoReflect

func (x *RouteChatResponse) ProtoReflect() protoreflect.Message

func (*RouteChatResponse) Reset

func (x *RouteChatResponse) Reset()

func (*RouteChatResponse) String

func (x *RouteChatResponse) String() string

type RouteGuideServiceClient

type RouteGuideServiceClient 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 *GetFeatureRequest, opts ...grpc.CallOption) (*GetFeatureResponse, 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 *ListFeaturesRequest, opts ...grpc.CallOption) (RouteGuideService_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) (RouteGuideService_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) (RouteGuideService_RouteChatClient, error)
}

RouteGuideServiceClient is the client API for RouteGuideService 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.

type RouteGuideServiceServer

type RouteGuideServiceServer 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, *GetFeatureRequest) (*GetFeatureResponse, 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(*ListFeaturesRequest, RouteGuideService_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(RouteGuideService_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(RouteGuideService_RouteChatServer) error
	// contains filtered or unexported methods
}

RouteGuideServiceServer is the server API for RouteGuideService service. All implementations must embed UnimplementedRouteGuideServiceServer for forward compatibility

type RouteGuideService_ListFeaturesClient

type RouteGuideService_ListFeaturesClient interface {
	Recv() (*ListFeaturesResponse, error)
	grpc.ClientStream
}

type RouteGuideService_ListFeaturesServer

type RouteGuideService_ListFeaturesServer interface {
	Send(*ListFeaturesResponse) error
	grpc.ServerStream
}

type RouteGuideService_RecordRouteClient

type RouteGuideService_RecordRouteClient interface {
	Send(*RecordRouteRequest) error
	CloseAndRecv() (*RecordRouteResponse, error)
	grpc.ClientStream
}

type RouteGuideService_RecordRouteServer

type RouteGuideService_RecordRouteServer interface {
	SendAndClose(*RecordRouteResponse) error
	Recv() (*RecordRouteRequest, error)
	grpc.ServerStream
}

type RouteGuideService_RouteChatClient

type RouteGuideService_RouteChatClient interface {
	Send(*RouteChatRequest) error
	Recv() (*RouteChatResponse, error)
	grpc.ClientStream
}

type RouteGuideService_RouteChatServer

type RouteGuideService_RouteChatServer interface {
	Send(*RouteChatResponse) error
	Recv() (*RouteChatRequest, 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 RouteNote is a message sent while at a given point.

func (*RouteNote) Descriptor deprecated

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

Deprecated: Use RouteNote.ProtoReflect.Descriptor instead.

func (*RouteNote) GetLocation

func (x *RouteNote) GetLocation() *Point

func (*RouteNote) GetMessage

func (x *RouteNote) GetMessage() string

func (*RouteNote) ProtoMessage

func (*RouteNote) ProtoMessage()

func (*RouteNote) ProtoReflect

func (x *RouteNote) ProtoReflect() protoreflect.Message

func (*RouteNote) Reset

func (x *RouteNote) Reset()

func (*RouteNote) String

func (x *RouteNote) String() string

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"`
	// contains filtered or unexported fields
}

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 deprecated

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

Deprecated: Use RouteSummary.ProtoReflect.Descriptor instead.

func (*RouteSummary) GetDistance

func (x *RouteSummary) GetDistance() int32

func (*RouteSummary) GetElapsedTime

func (x *RouteSummary) GetElapsedTime() int32

func (*RouteSummary) GetFeatureCount

func (x *RouteSummary) GetFeatureCount() int32

func (*RouteSummary) GetPointCount

func (x *RouteSummary) GetPointCount() 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 UnimplementedRouteGuideServiceServer

type UnimplementedRouteGuideServiceServer struct {
}

UnimplementedRouteGuideServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedRouteGuideServiceServer) GetFeature

func (UnimplementedRouteGuideServiceServer) ListFeatures

func (UnimplementedRouteGuideServiceServer) RecordRoute

func (UnimplementedRouteGuideServiceServer) RouteChat

type UnsafeRouteGuideServiceServer

type UnsafeRouteGuideServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeRouteGuideServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RouteGuideServiceServer will result in compilation errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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