railpredictions

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetNextTrainResponse

type GetNextTrainResponse struct {
	XMLName xml.Name `json:"-" xml:"http://www.wmata.com AIMPredictionResp"`
	Trains  []Train  `json:"Trains" xml:"Trains>AIMPredictionTrainInfo"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL