monitor

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package monitor monitors gtfs a vehicle feed

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunVehicleMonitorLoop

func RunVehicleMonitorLoop(log *log.Logger,
	db *sqlx.DB,
	url string,
	loopEverySeconds int,
	earlyTolerance float64,
	expirePositionSeconds int,
	shutdownSignal chan os.Signal) error

RunVehicleMonitorLoop starts loop that monitors gtfs-rt feed and records results for use in ML processing.

Types

type StopTimePair

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

StopTimePair contains the to and from gtfs.StopTimeInstance for a stop transition on a gtfs.TripInstance

type VehicleStopStatus

type VehicleStopStatus int

VehicleStopStatus defines the possible relationship a vehicle has to a stop in GTFS

const (
	Unknown VehicleStopStatus = -1
	// IncomingAt indicates vehicle is just about to arrive at the stop (on a stop
	// display, the vehicle symbol typically flashes).
	IncomingAt VehicleStopStatus = 0
	// StoppedAt indicates vehicle is at the stop.
	StoppedAt VehicleStopStatus = 1
	// InTransitTo indicates vehicle has departed a previous stop and is in transit to the next stop.
	InTransitTo VehicleStopStatus = 2
)

func (*VehicleStopStatus) IsUnknown

func (s *VehicleStopStatus) IsUnknown() bool

IsUnknown convenience method to test for unknown VehicleStopStatus

func (*VehicleStopStatus) String

func (s *VehicleStopStatus) String() string

String - Stringer interface for VehicleStopStatus

Jump to

Keyboard shortcuts

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