Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetLiveTrainPositionsResponse ¶
type GetLiveTrainPositionsResponse struct { XMLName xml.Name `json:"-" xml:"http://www.wmata.com TrainPositionResp"` Positions []TrainPosition `json:"TrainPositions" xml:"TrainPositions>TrainPosition"` }
type GetTrackCircuitsResponse ¶
type GetTrackCircuitsResponse struct { XMLName xml.Name `json:"-" xml:"http://www.wmata.com TrackCircuitResp"` TrackCircuits []TrackCircuit `json:"TrackCircuits" xml:"TrackCircuits>TrackCircuit"` }
type Route ¶
type Route struct { LineCode string `json:"LineCode" xml:"LineCode"` TrackNumber int `json:"TrackNum" xml:"TrackNum"` TrackCircuits []StandardTrackCircuit `json:"TrackCircuits" xml:"TrackCircuits>TrackCircuit"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides all API methods for the TrainPositions API
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) GetLiveTrainPositions ¶
func (service *Service) GetLiveTrainPositions() (*GetLiveTrainPositionsResponse, error)
GetLiveTrainPositions retrieves information on the trains that are currently in service and where they are Documentation on service structure can be found here: https://developer.wmata.com/docs/services/5763fa6ff91823096cac1057/operations/5763fb35f91823096cac1058
func (*Service) GetStandardRoutes ¶
func (service *Service) GetStandardRoutes() (*GetStandardRoutesResponse, error)
GetStandardRoutes retrieves an ordered list of standard routes Documentation on service structure can be found here: https://developer.wmata.com/docs/services/5763fa6ff91823096cac1057/operations/57641afc031f59363c586dca?
func (*Service) GetTrackCircuits ¶
func (service *Service) GetTrackCircuits() (*GetTrackCircuitsResponse, error)
GetTrackCircuits retrieves a list of all track circuits with reference to neighbors Documentation on service structure can be found here: https://developer.wmata.com/docs/services/5763fa6ff91823096cac1057/operations/57644238031f59363c586dcb?
type StandardTrackCircuit ¶
type TrackCircuit ¶
type TrainPosition ¶
type TrainPosition struct { CarCount int `json:"CarCount" xml:"CarCount"` CircuitID int `json:"CircuitId" xml:"CircuitId"` DestinationStationCode string `json:"DestinationStationCode" xml:"DestinationStationCode"` DirectionNumber int `json:"DirectionNum" xml:"DirectionNum"` LineCode string `json:"LineCode" xml:"LineCode"` SecondsAtLocation int `json:"SecondsAtLocation" xml:"SecondsAtLocation"` ServiceType string `json:"ServiceType" xml:"ServiceType"` TrainID string `json:"TrainId" xml:"TrainId"` TrainNumber string `json:"TrainNumber" xml:"TrainNumber"` }
type TrainPositions ¶
type TrainPositions interface { GetLiveTrainPositions() (*GetLiveTrainPositionsResponse, error) GetStandardRoutes() (*GetStandardRoutesResponse, error) GetTrackCircuits() (*GetTrackCircuitsResponse, error) }
TrainPositions defines the methods available in the WMATA "Train Positions" API