Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NextTrainTimes ¶
func NextTrainTimes(updates []*StopTimeUpdate) []time.Time
NextTrainTimes will extract the departure times from the given update slice, order and return them.
Types ¶
type Alert ¶
type Alert struct {
transit_realtime.Alert
}
type FeedMessage ¶
type FeedMessage struct {
transit_realtime.FeedMessage
}
func GetFeed ¶
GetFeed takes an API key generated from http://datamine.mta.info/user/register and a boolean specifying which feed (1,2,3,4,5,6,S trains OR L train) and it will return a transit_realtime.FeedMessage with NYCT extensions.
func (*FeedMessage) NextTrainTimes ¶
func (f *FeedMessage) NextTrainTimes(stopId, line string) (alerts []*Alert, northbound, southbound []time.Time)
NextTrainTimes will return an ordered slice of upcoming train departure times in either direction.
func (*FeedMessage) Trains ¶
func (f *FeedMessage) Trains(stopId, line string) (alerts []*Alert, northbound, southbound []*StopTimeUpdate)
Trains will accept a stopId plus a train line (found here: http://web.mta.info/developers/data/nyct/subway/google_transit.zip) and returns a list of updates from northbound and southbound trains
type StopTimeUpdate ¶
type StopTimeUpdate struct {
transit_realtime.TripUpdate_StopTimeUpdate
}
Click to show internal directories.
Click to hide internal directories.