track

package
v0.0.0-...-693da34 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delays

func Delays() []*gtfs.TripDescriptor

func Entities

func Entities() []*gtfs.FeedEntity

func Feed

func Feed(url string) gtfs.FeedMessage

Types

type Tracker

type Tracker struct{}

Tracker manages the state of ride execution.

func (*Tracker) FutureArrivalTime

func (t *Tracker) FutureArrivalTime(r *ride.Ride, s *ride.Station) time.Time

FutureArrivalTime returns the when the ride will reach the station.

func (*Tracker) HasArrived

func (t *Tracker) HasArrived(r *ride.Ride, s *ride.Station) (bool, error)

HasArrived returns whether the ride has reached the station. returns error if ride's route those not include the station

func (*Tracker) NotifyWhenArrive

func (t *Tracker) NotifyWhenArrive(r *ride.Ride, s *ride.Station) (chan bool, error)

NotifyWhenArrive send to a channel when ride will reach station.

func (*Tracker) PastArrivalTime

func (t *Tracker) PastArrivalTime(r *ride.Ride, s *ride.Station) time.Time

PastArrivalTime returns the when the ride had arrived the station.

func (*Tracker) RideCapacity

func (t *Tracker) RideCapacity(r *ride.Ride) (uint32, error)

RideCapacity returns how many people are in the current ride. returns error if the ride was not found or has not started.

Jump to

Keyboard shortcuts

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