route

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InformationGetter

type InformationGetter interface {
	// GetInformation finds and calculates some information on the given point, then calls onPointRecorded passing the information to it.
	GetInformation(
		ctx context.Context,
		previousPoint model.Point,
		point model.Point,
		onPointAdded OnPointAdded,
	) error
}

InformationGetter is an interface for recording a route composited of a sequence of points.

type MessagePoster

type MessagePoster interface {
	// PostMessage posts the given message to the given point, then calls onPostedMessage for each message posted on the point.
	PostMessage(
		ctx context.Context,
		point model.Point,
		message string,
		onPostedMessage OnPostedMessage,
	) error
}

MessagePoster is an interface for posting a message to a point.

type OnPointAdded

type OnPointAdded func(point model.Point, matchedFeature *model.Feature, addedDistance int32) error

type OnPostedMessage

type OnPostedMessage func(message string) error

type RouteInformationGetter

type RouteInformationGetter struct {
	// contains filtered or unexported fields
}

func NewRouteInformationGetter

func NewRouteInformationGetter(
	features repository.Features,
) *RouteInformationGetter

func (*RouteInformationGetter) GetInformation

func (r *RouteInformationGetter) GetInformation(
	ctx context.Context,
	previousPoint model.Point,
	point model.Point,
	onPointAdded OnPointAdded,
) error

type RouteMessagePoster

type RouteMessagePoster struct {
	// contains filtered or unexported fields
}

func NewRouteMessagePoster

func NewRouteMessagePoster(
	feature repository.Features,
	messages repository.Messages,
) *RouteMessagePoster

func (*RouteMessagePoster) PostMessage

func (r *RouteMessagePoster) PostMessage(
	ctx context.Context,
	point model.Point,
	message string,
	onPostedMessage OnPostedMessage,
) error

Jump to

Keyboard shortcuts

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