models

package
v0.0.0-...-3ec9b05 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package models provides the internal view of the NYC subway realtime feed.

It provides the internal data definitions and some light business logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Effect string
	Header string
}

An Alert is a type of service disruption, delay, etc.

type FeedUpdate

type FeedUpdate struct {
	Alerts        []Alert
	StationStatus map[string]StationStatus
}

FeedUpdate represents the status at a given moment.

type StationStatus

type StationStatus struct {
	StopID          string
	StopIDToUpdates map[string][]StationUpdate // multiple directions will be separate keys
}

A StationStatus records all scheduled arrivals and departures for a given stop. Stops on the same line, but in different directions, will be grouped into a given StationStatus struct.

type StationUpdate

type StationUpdate struct {
	TripID    string
	Arrival   time.Time
	Departure time.Time
}

StationUpdate records a scheduled (or realtime) arrival and departure for a trip at a particular station.

Jump to

Keyboard shortcuts

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