Documentation
¶
Index ¶
- Variables
- func ConvertToTrainSliceAndParse(stopTimeUpdateSlice []*types.StopTimeUpdate) ([]*types.Train, types.ParsedByDirection)
- func DefaultSort(parsed types.ParsedByDirection) types.ParsedByDirection
- func DescendingSort(parsed types.ParsedByDirection) types.ParsedByDirection
- func FindStopData(update *gtfs.TripUpdate_StopTimeUpdate, stopID string) (bool, *types.StopTimeUpdate)
- func HandleFetchTransitData(subwayLine string) []*gtfs.TripUpdate_StopTimeUpdate
- func TestGen(parsed types.ParsedByDirection) types.ParsedByDirection
- type ParsedStationMap
- type StaticData
- type Station
- type SubwayStationMap
Constants ¶
This section is empty.
Variables ¶
View Source
var MTA_API_KEY = "ny459qNK3B9V8B6MiY3FD7I2GFBzeUTG7qvqRHQe"
View Source
var SUBWAY_LINE_REQUEST_URLS = map[string]string{
"L": "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-l",
"ACE": "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-ace",
"BDFM": "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-bdfm",
"G": "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-g",
"JZ": "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-jz",
"NQRW": "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-nqrw",
"NUMBERS": "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs",
"SERVICE": "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/camsys%2Fsubway-alerts.json",
}
Functions ¶
func ConvertToTrainSliceAndParse ¶
func ConvertToTrainSliceAndParse(stopTimeUpdateSlice []*types.StopTimeUpdate) ([]*types.Train, types.ParsedByDirection)
ConvertToTrainSliceAndParse Function
func DefaultSort ¶
func DefaultSort(parsed types.ParsedByDirection) types.ParsedByDirection
DefaultSort Function
func DescendingSort ¶
func DescendingSort(parsed types.ParsedByDirection) types.ParsedByDirection
DescendingSort Function
func FindStopData ¶
func FindStopData(update *gtfs.TripUpdate_StopTimeUpdate, stopID string) (bool, *types.StopTimeUpdate)
FindStopData Function
func HandleFetchTransitData ¶
func HandleFetchTransitData(subwayLine string) []*gtfs.TripUpdate_StopTimeUpdate
func TestGen ¶
func TestGen(parsed types.ParsedByDirection) types.ParsedByDirection
TestGen Function
Types ¶
type ParsedStationMap ¶
type StaticData ¶
type StaticData struct {
Map SubwayStationMap `json:"map"`
}
type Station ¶
type Station struct {
StationID string `json:"stationId"`
ComplexID string `json:"complexId"`
StopID string `json:"stopID"`
SubwayLine string `json:"subwayLine"`
StopName string `json:"stopName"`
Borough string `json:"borough"`
Routes string `json:"routes"`
Lattitude string `json:"lattitude"`
Longitude string `json:"longitude"`
NorthDirection string `json:"northDirectionLabel"`
SouthDirection string `json:"southDirectionLabel"`
}
Station struct
type SubwayStationMap ¶
type SubwayStationMap struct {
NUMBERS ParsedStationMap
ACE ParsedStationMap
BDFM ParsedStationMap
NQRW ParsedStationMap
L ParsedStationMap
G ParsedStationMap
S ParsedStationMap
JZ ParsedStationMap
SERVICE ParsedStationMap
}
SubwayStationMap is a slice of stations mapped to a subway line
Click to show internal directories.
Click to hide internal directories.