handler

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RouteGuide

type RouteGuide struct {
	Features  []*pb.Feature
	Notes     map[string][]*pb.RouteNote
	NotesLock sync.Mutex
}

RouteGuide implements the route guide handler interface

func (*RouteGuide) GetFeature

func (r *RouteGuide) GetFeature(ctx context.Context, point *pb.Point, feature *pb.Feature) error

GetFeature obtains the feature at a given position.

func (*RouteGuide) ListFeatures

func (r *RouteGuide) ListFeatures(ctx context.Context, rect *pb.Rectangle, stream pb.RouteGuide_ListFeaturesStream) error

ListFeatures 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.

func (*RouteGuide) RecordRoute

func (r *RouteGuide) RecordRoute(ctx context.Context, stream pb.RouteGuide_RecordRouteStream) error

RecordRoute accepts a stream of Points on a route being traversed, returning a RouteSummary when traversal is completed.

func (*RouteGuide) RouteChat

func (r *RouteGuide) RouteChat(ctx context.Context, stream pb.RouteGuide_RouteChatStream) error

RouteChat accepts a stream of RouteNotes sent while a route is being traversed, while receiving other RouteNotes (e.g. from other users).

Jump to

Keyboard shortcuts

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