tflarrivals

package
v0.0.0-...-d39733c Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TfLAppKey string

Functions

func RegisterCLI

func RegisterCLI() *cli.Command

Types

type ArrivalPrediction

type ArrivalPrediction struct {
	ID            string `json:"id"`
	OperationType int    `json:"operationType"`
	VehicleID     string `json:"vehicleId"`

	NaptanID    string `json:"naptanId"`
	StationName string `json:"stationName"`

	LineID   string `json:"lineId"`
	LineName string `json:"lineName"`

	PlatformName string `json:"platformName"`
	Direction    string `json:"direction"`
	Bearing      string `json:"bearing"`

	TripID string `json:"tripId"`

	DestinationNaptanID string `json:"destinationNaptanId"`
	DestinationName     string `json:"destinationName"`

	TimeToStation int `json:"timeToStation"`

	CurrentLocation string `json:"currentLocation"`
	Towards         string `json:"towards"`

	ExpectedArrival string `json:"expectedArrival"`

	ModeName string `json:"modeName"`
}

type BusBatchConsumer

type BusBatchConsumer struct {
}

func NewBusBatchConsumer

func NewBusBatchConsumer() *BusBatchConsumer

func (*BusBatchConsumer) Consume

func (c *BusBatchConsumer) Consume(batch rmq.Deliveries)

func (*BusBatchConsumer) IdentifyBus

func (c *BusBatchConsumer) IdentifyBus(event BusMonitorEvent) (string, error)

func (*BusBatchConsumer) Test

func (c *BusBatchConsumer) Test()

type BusMonitorEvent

type BusMonitorEvent struct {
	Line                     string
	DirectionRef             string
	NumberPlate              string
	OriginRef                string
	DestinationRef           string
	OriginAimedDepartureTime string
}

type ModeArrivalTracker

type ModeArrivalTracker struct {
	Mode        *TfLMode
	RefreshRate time.Duration

	RuntimeJourneyFilter func(string, string) bool
}

func (*ModeArrivalTracker) GetLatestArrivals

func (l *ModeArrivalTracker) GetLatestArrivals() []ArrivalPrediction

func (*ModeArrivalTracker) ParseArrivals

func (l *ModeArrivalTracker) ParseArrivals(lineArrivals []ArrivalPrediction)

func (*ModeArrivalTracker) Run

func (l *ModeArrivalTracker) Run(getRoutes bool)

type ModeDisruptionTracker

type ModeDisruptionTracker struct {
	Mode        *TfLMode
	RefreshRate time.Duration
	Service     *ctdf.Service
}

func (*ModeDisruptionTracker) GetDisruptions

func (d *ModeDisruptionTracker) GetDisruptions()

func (*ModeDisruptionTracker) GetLineStatuses

func (d *ModeDisruptionTracker) GetLineStatuses()

func (*ModeDisruptionTracker) Run

func (d *ModeDisruptionTracker) Run()

type OrderedLineRoute

type OrderedLineRoute struct {
	Name      string   `json:"name"`
	NaptanIDs []string `json:"naptanIds"`
}

type RouteSequenceResponse

type RouteSequenceResponse struct {
	LineStrings       []string           `json:"lineStrings"`
	OrderedLineRoutes []OrderedLineRoute `json:"orderedLineRoutes"`
}

type TfLLine

type TfLLine struct {
	LineID        string
	LineName      string
	TransportType ctdf.TransportType

	OrderedLineRoutes []OrderedLineRoute

	Service *ctdf.Service
}

func (*TfLLine) GetService

func (l *TfLLine) GetService()

func (*TfLLine) GetTfLRouteSequences

func (l *TfLLine) GetTfLRouteSequences()

type TfLMode

type TfLMode struct {
	ModeID        string
	TransportType ctdf.TransportType

	Lines map[string]*TfLLine

	TrackArrivals    bool
	TrackDisruptions bool

	ArrivalRefreshRate    time.Duration
	DisruptionRefreshRate time.Duration
}

func (*TfLMode) GetLines

func (m *TfLMode) GetLines()

type TflTracker

type TflTracker struct {
	Line             string
	TripID           string
	CreationDateTime time.Time
}

type TrackerManager

type TrackerManager struct {
	Modes []*TfLMode

	RuntimeJourneyFilter func(string, string) bool
}

func (TrackerManager) Run

func (t TrackerManager) Run(getRoutes bool)

Jump to

Keyboard shortcuts

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