Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BusPredictions ¶
type BusPredictions interface {
GetNextBuses(stopID string) (*GetNextBusResponse, error)
}
BusPredictions defines the method available in the WMATA "Real-Time Bus Predictions" API
type GetNextBusResponse ¶
type GetNextBusResponse struct { XMLName xml.Name `json:"-" xml:"http://www.wmata.com NextBusResponse"` NextBusPredictions []NextBusPrediction `json:"Predictions" xml:"Predictions>NextBusPrediction"` StopName string `json:"StopName" xml:"StopName"` }
type NextBusPrediction ¶
type NextBusPrediction struct { DirectionNumber string `json:"DirectionNum" xml:"DirectionNum"` DirectionText string `json:"DirectionText" xml:"DirectionText"` Minutes int `json:"Minutes" xml:"Minutes"` RouteID string `json:"RouteID" xml:"RouteID"` TripID string `json:"TripID" xml:"TripID"` VehicleID string `json:"VehicleID" xml:"VehicleID"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides all API methods for BusPredictions
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) GetNextBuses ¶
func (service *Service) GetNextBuses(stopID string) (*GetNextBusResponse, error)
GetNexBuses retrieves next bus arrival times by stopID Documentation on service structure can be found here: https://developer.wmata.com/docs/services/5476365e031f590f38092508/operations/5476365e031f5909e4fe331d
Click to show internal directories.
Click to hide internal directories.