routeguidev1connect

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: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RouteGuideServiceGetFeatureProcedure is the fully-qualified name of the RouteGuideService's
	// GetFeature RPC.
	RouteGuideServiceGetFeatureProcedure = "/routeguide.v1.RouteGuideService/GetFeature"
	// RouteGuideServiceListFeaturesProcedure is the fully-qualified name of the RouteGuideService's
	// ListFeatures RPC.
	RouteGuideServiceListFeaturesProcedure = "/routeguide.v1.RouteGuideService/ListFeatures"
	// RouteGuideServiceRecordRouteProcedure is the fully-qualified name of the RouteGuideService's
	// RecordRoute RPC.
	RouteGuideServiceRecordRouteProcedure = "/routeguide.v1.RouteGuideService/RecordRoute"
	// RouteGuideServiceRouteChatProcedure is the fully-qualified name of the RouteGuideService's
	// RouteChat RPC.
	RouteGuideServiceRouteChatProcedure = "/routeguide.v1.RouteGuideService/RouteChat"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// RouteGuideServiceName is the fully-qualified name of the RouteGuideService service.
	RouteGuideServiceName = "routeguide.v1.RouteGuideService"
)

Variables

This section is empty.

Functions

func NewRouteGuideServiceHandler

func NewRouteGuideServiceHandler(svc RouteGuideServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)

NewRouteGuideServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

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(context.Context, *connect_go.Request[v1.GetFeatureRequest]) (*connect_go.Response[v1.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(context.Context, *connect_go.Request[v1.ListFeaturesRequest]) (*connect_go.ServerStreamForClient[v1.ListFeaturesResponse], 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(context.Context) *connect_go.ClientStreamForClient[v1.RecordRouteRequest, v1.RecordRouteResponse]
	// 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(context.Context) *connect_go.BidiStreamForClient[v1.RouteChatRequest, v1.RouteChatResponse]
}

RouteGuideServiceClient is a client for the routeguide.v1.RouteGuideService service.

func NewRouteGuideServiceClient

func NewRouteGuideServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) RouteGuideServiceClient

NewRouteGuideServiceClient constructs a client for the routeguide.v1.RouteGuideService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type RouteGuideServiceHandler

type RouteGuideServiceHandler 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, *connect_go.Request[v1.GetFeatureRequest]) (*connect_go.Response[v1.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(context.Context, *connect_go.Request[v1.ListFeaturesRequest], *connect_go.ServerStream[v1.ListFeaturesResponse]) 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(context.Context, *connect_go.ClientStream[v1.RecordRouteRequest]) (*connect_go.Response[v1.RecordRouteResponse], 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(context.Context, *connect_go.BidiStream[v1.RouteChatRequest, v1.RouteChatResponse]) error
}

RouteGuideServiceHandler is an implementation of the routeguide.v1.RouteGuideService service.

type UnimplementedRouteGuideServiceHandler

type UnimplementedRouteGuideServiceHandler struct{}

UnimplementedRouteGuideServiceHandler returns CodeUnimplemented from all methods.

Jump to

Keyboard shortcuts

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