connect

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RouteGuideServer

type RouteGuideServer struct {
	routeguidev1connect.UnimplementedRouteGuideServiceHandler
	// contains filtered or unexported fields
}

func NewServer

func NewServer(repositories *repository.Repositories) (*RouteGuideServer, error)

func (*RouteGuideServer) GetFeature

func (s *RouteGuideServer) GetFeature(
	ctx context.Context,
	request *connect.Request[routeguidev1.GetFeatureRequest],
) (*connect.Response[routeguidev1.GetFeatureResponse], error)

GetFeature returns the feature at the given point.

func (*RouteGuideServer) ListFeatures

func (s *RouteGuideServer) ListFeatures(
	ctx context.Context,
	request *connect.Request[routeguidev1.ListFeaturesRequest],
	stream *connect.ServerStream[routeguidev1.ListFeaturesResponse],
) error

ListFeatures lists all features contained within the given bounding Rectangle.

func (*RouteGuideServer) RecordRoute

func (s *RouteGuideServer) RecordRoute(
	ctx context.Context,
	stream *connect.ClientStream[routeguidev1.RecordRouteRequest],
) (*connect.Response[routeguidev1.RecordRouteResponse], error)

RecordRoute records a route composited of a sequence of points.

It gets a stream of points, and responds with statistics about the "trip": number of points, number of known features visited, total distance traveled, and total time spent.

func (*RouteGuideServer) RouteChat

func (s *RouteGuideServer) RouteChat(
	ctx context.Context,
	stream *connect.BidiStream[routeguidev1.RouteChatRequest, routeguidev1.RouteChatResponse],
) error

RouteChat receives a stream of message/location pairs, and responds with a stream of all previous messages at each of those locations.

Jump to

Keyboard shortcuts

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