Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetNextTrainResponse ¶
type RailPredictions ¶
type RailPredictions interface {
GetNextTrains(stationCodes []string) (*GetNextTrainResponse, error)
}
RailPredictions defines the method available in the WMATA "Real-Time Rail Predictions" API
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides all API methods for RailPredictions
func NewService ¶
func NewService(client *wmata.Client, responseType wmata.ResponseType) *Service
NewService returns a new Incidents service with a reference to an existing wmata.Client
func (*Service) GetNextTrains ¶
func (service *Service) GetNextTrains(stationCodes []string) (*GetNextTrainResponse, error)
GetNextTrains retrieves realtime rail predictions for each station code passed. If no station codes passed, then all predictions will be retrieved Documentation on service structure can be found here: https://developer.wmata.com/docs/services/547636a6f9182302184cda78/operations/547636a6f918230da855363f
type Train ¶
type Train struct { Car string `json:"Car" xml:"Car"` Destination string `json:"Destination" xml:"Destination"` DestinationCode string `json:"DestinationCode" xml:"DestinationCode"` DestinationName string `json:"DestinationName" xml:"DestinationName"` Group string `json:"Group" xml:"Group"` Line string `json:"Line" xml:"Line"` LocationCode string `json:"LocationCode" xml:"LocationCode"` LocationName string `json:"LocationName" xml:"LocationName"` Minutes string `json:"Min" xml:"Min"` }
Click to show internal directories.
Click to hide internal directories.