Documentation ¶
Index ¶
- type AllDayParking
- type GetLinesResponse
- type GetParkingInformationResponse
- type GetPathBetweenStationsResponse
- type GetStationEntrancesRequest
- type GetStationEntrancesResponse
- type GetStationInformationResponse
- type GetStationListResponse
- type GetStationListResponseItem
- type GetStationTimingsResponse
- type GetStationToStationInformationResponse
- type LineResponse
- type PathItem
- type RailFare
- type RailInfo
- type Service
- func (railService *Service) GetLines() (*GetLinesResponse, error)
- func (railService *Service) GetParkingInformation(stationCode string) (*GetParkingInformationResponse, error)
- func (railService *Service) GetPathBetweenStations(fromStation, toStation string) (*GetPathBetweenStationsResponse, error)
- func (railService *Service) GetStationEntrances(getStationEntranceRequest *GetStationEntrancesRequest) (*GetStationEntrancesResponse, error)
- func (railService *Service) GetStationInformation(stationCode string) (*GetStationInformationResponse, error)
- func (railService *Service) GetStationList(lineCode string) (*GetStationListResponse, error)
- func (railService *Service) GetStationTimings(stationCode string) (*GetStationTimingsResponse, error)
- func (railService *Service) GetStationToStationInformation(fromStation, toStation string) (*GetStationToStationInformationResponse, error)
- type ShortTermParking
- type StationAddress
- type StationDayItem
- type StationEntrance
- type StationParking
- type StationTime
- type StationToStation
- type StationTrainInformation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllDayParking ¶
type AllDayParking struct { TotalCount int `json:"TotalCount" xml:"TotalCount"` RiderCost float64 `json:"RiderCost" xml:"RiderCost"` NonRiderCost float64 `json:"NonRiderCost" xml:"NonRiderCost"` SaturdayRiderCost float64 `json:"SaturdayRiderCost" xml:"SaturdayRiderCost"` SaturdayNonRiderCost float64 `json:"SaturdayNonRiderCost" xml:"SaturdayNonRiderCost"` }
type GetLinesResponse ¶
type GetLinesResponse struct { XMLName xml.Name `json:"-" xml:"http://www.wmata.com LinesResp"` Lines []LineResponse `json:"Lines" xml:"Lines>Line"` }
type GetParkingInformationResponse ¶
type GetParkingInformationResponse struct { XMLName xml.Name `json:"-" xml:"http://www.wmata.com StationParkingResp"` ParkingInformation []StationParking `json:"StationsParking" xml:"StationsParking>StationParking"` }
type GetStationEntrancesResponse ¶
type GetStationEntrancesResponse struct { XMLName xml.Name `json:"-" xml:"http://www.wmata.com StationEntrancesResp"` Entrances []StationEntrance `json:"Entrances" xml:"Entrances>StationEntrance"` }
type GetStationInformationResponse ¶
type GetStationInformationResponse struct { XMLName xml.Name `json:"-" xml:"http://www.wmata.com Station"` Address StationAddress `json:"Address" xml:"Address"` Latitude float64 `json:"Lat" xml:"Lat"` LineCode1 string `json:"LineCode1" xml:"LineCode1"` LineCode2 string `json:"LineCode2" xml:"LineCode2"` Longitude float64 `json:"Lon" xml:"Lon"` Name string `json:"Name" xml:"Name"` StationCode string `json:"Code" xml:"Code"` StationTogether1 string `json:"StationTogether1" xml:"StationTogether1"` StationTogether2 string `json:"StationTogether2" xml:"StationTogether2"` }
type GetStationListResponse ¶
type GetStationListResponse struct { XMLName xml.Name `json:"-" xml:"http://www.wmata.com StationsResp"` Stations []GetStationListResponseItem `json:"Stations" xml:"Stations>Station"` }
type GetStationListResponseItem ¶
type GetStationListResponseItem struct { Address StationAddress `json:"Address" xml:"Address"` StationCode string `json:"Code" xml:"Code"` Latitude float64 `json:"Lat" xml:"Lat"` LineCode1 string `json:"LineCode1" xml:"LineCode1"` LineCode2 string `json:"LineCode2" xml:"LineCode2"` LineCode3 string `json:"LineCode3" xml:"LineCode3"` LineCode4 string `json:"LineCode4" xml:"LineCode4"` Longitude float64 `json:"Lon" xml:"Lon"` Name string `json:"Name" xml:"Name"` StationTogether1 string `json:"StationTogether1" xml:"StationTogether1"` StationTogether2 string `json:"StationTogether2" xml:"StationTogether2"` }
type GetStationTimingsResponse ¶
type GetStationTimingsResponse struct { XMLName xml.Name `json:"-" xml:"http://www.wmata.com StationTimeResp"` StationTimes []StationTime `json:"StationTimes" xml:"StationTimes>StationTime"` }
type GetStationToStationInformationResponse ¶
type GetStationToStationInformationResponse struct { XMLName xml.Name `json:"-" xml:"http://www.wmata.com StationToStationInfoResp"` StationToStationInformation []StationToStation `json:"StationToStationInfos" xml:"StationToStationInfos>StationToStationInfo"` }
type LineResponse ¶
type LineResponse struct { DisplayName string `json:"DisplayName" xml:"DisplayName"` EndStationCode string `json:"EndStationCode" xml:"EndStationCode"` InternalDestination1 string `json:"InternalDestination1" xml:"InternalDestination1"` InternalDestination2 string `json:"InternalDestination2" xml:"InternalDestination2"` LineCode string `json:"LineCode" xml:"LineCode"` StartStationCode string `json:"StartStationCode" xml:"StartStationCode"` }
type PathItem ¶
type PathItem struct { DistanceToPreviousStation int `json:"DistanceToPrev" xml:"DistanceToPrev"` LineCode string `json:"LineCode" xml:"LineCode"` SequenceNumber int `json:"SeqNum" xml:"SeqNum"` StationCode string `json:"StationCode" xml:"StationCode"` StationName string `json:"StationName" xml:"StationName"` }
type RailInfo ¶
type RailInfo interface { GetLines() (*GetLinesResponse, error) GetParkingInformation(stationCode string) (*GetParkingInformationResponse, error) GetPathBetweenStations(fromStation, toStation string) (*GetPathBetweenStationsResponse, error) GetStationEntrances(getStationEntranceRequest *GetStationEntrancesRequest) (*GetStationEntrancesResponse, error) GetStationInformation(stationCode string) (*GetStationInformationResponse, error) GetStationList(lineCode string) (*GetStationListResponse, error) GetStationTimings(stationCode string) (*GetStationTimingsResponse, error) GetStationToStationInformation(fromStation, toStation string) (*GetStationToStationInformationResponse, error) }
RailInfo defines the methods available in the WMATA "Rail Station Information" API
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides all API methods for Rail Station Information from WMATA
func NewService ¶
func NewService(client *wmata.Client, responseType wmata.ResponseType) *Service
NewService returns a new Service service with a reference to an existing wmata.Client
func (*Service) GetLines ¶
func (railService *Service) GetLines() (*GetLinesResponse, error)
GetLines retrieves information about all rail lines Documentation on service structure can be found here: https://developer.wmata.com/docs/services/5476364f031f590f38092507/operations/5476364f031f5909e4fe330c
func (*Service) GetParkingInformation ¶
func (railService *Service) GetParkingInformation(stationCode string) (*GetParkingInformationResponse, error)
GetParkingInformation retrieves parking information for a given station Documentation on service structure can be found here: https://developer.wmata.com/docs/services/5476364f031f590f38092507/operations/5476364f031f5909e4fe330d?
func (*Service) GetPathBetweenStations ¶
func (railService *Service) GetPathBetweenStations(fromStation, toStation string) (*GetPathBetweenStationsResponse, error)
GetPathBetweenStations retrieves an ordered list of stations and distances between two stations Documentation on service structure can be found here: https://developer.wmata.com/docs/services/5476364f031f590f38092507/operations/5476364f031f5909e4fe330e?
func (*Service) GetStationEntrances ¶
func (railService *Service) GetStationEntrances(getStationEntranceRequest *GetStationEntrancesRequest) (*GetStationEntrancesResponse, error)
GetStationEntrances retrieves a list of station entrances near the provided coordinates Documentation on service structure can be found here: https://developer.wmata.com/docs/services/5476364f031f590f38092507/operations/5476364f031f5909e4fe330f?
func (*Service) GetStationInformation ¶
func (railService *Service) GetStationInformation(stationCode string) (*GetStationInformationResponse, error)
GetStationInformation retrieves station location and address information by station code Documentation on service structure can be found here: https://developer.wmata.com/docs/services/5476364f031f590f38092507/operations/5476364f031f5909e4fe3310?
func (*Service) GetStationList ¶
func (railService *Service) GetStationList(lineCode string) (*GetStationListResponse, error)
GetStationList retrieves a list of station location and address information for all stations on a given line Documentation on service structure can be found here: https://developer.wmata.com/docs/services/5476364f031f590f38092507/operations/5476364f031f5909e4fe3311?
func (*Service) GetStationTimings ¶
func (railService *Service) GetStationTimings(stationCode string) (*GetStationTimingsResponse, error)
GetStationTimings retrieves opening and scheduled first and last train times for a given station Documentation on service structure can be found here: https://developer.wmata.com/docs/services/5476364f031f590f38092507/operations/5476364f031f5909e4fe3312?
func (*Service) GetStationToStationInformation ¶
func (railService *Service) GetStationToStationInformation(fromStation, toStation string) (*GetStationToStationInformationResponse, error)
GetStationToStationInformation retrieves distance, fare and estimated travel time between the given two stations Documentation on service structure can be found here: https://developer.wmata.com/docs/services/5476364f031f590f38092507/operations/5476364f031f5909e4fe3313?
type ShortTermParking ¶
type StationAddress ¶
type StationDayItem ¶
type StationDayItem struct { OpeningTime string `json:"OpeningTime" xml:"OpeningTime"` FirstTrains []StationTrainInformation `json:"FirstTrains" xml:"FirstTrains>Train"` LastTrains []StationTrainInformation `json:"LastTrains" xml:"LastTrains>Train"` }
type StationEntrance ¶
type StationEntrance struct { Description string `json:"Description" xml:"Description"` // Deprecated: ID response field is deprecated ID string `json:"ID" xml:"ID"` Latitude float64 `json:"Lat" xml:"Lat"` Longitude float64 `json:"Lon" xml:"Lon"` Name string `json:"Name" xml:"Name"` StationCode1 string `json:"StationCode1" xml:"StationCode1"` StationCode2 string `json:"StationCode2" xml:"StationCode2"` }
type StationParking ¶
type StationParking struct { StationCode string `json:"Code" xml:"Code"` Notes string `json:"Notes" xml:"Notes"` AllDay AllDayParking `json:"AllDayParking" xml:"AllDayParking"` ShortTerm ShortTermParking `json:"ShortTermParking" xml:"ShortTermParking"` }
type StationTime ¶
type StationTime struct { StationCode string `json:"Code" xml:"Code"` StationName string `json:"StationName" xml:"StationName"` Monday StationDayItem `json:"Monday" xml:"Monday"` Tuesday StationDayItem `json:"Tuesday" xml:"Tuesday"` Wednesday StationDayItem `json:"Wednesday" xml:"Wednesday"` Thursday StationDayItem `json:"Thursday" xml:"Thursday"` Friday StationDayItem `json:"Friday" xml:"Friday"` Saturday StationDayItem `json:"Saturday" xml:"Saturday"` Sunday StationDayItem `json:"Sunday" xml:"Sunday"` }
type StationToStation ¶
type StationToStation struct { CompositeMiles float64 `json:"CompositeMiles" xml:"CompositeMiles"` DestinationStation string `json:"DestinationStation" xml:"DestinationStation"` Fare RailFare `json:"RailFare" xml:"RailFare"` Time int `json:"RailTime" xml:"RailTime"` SourceStation string `json:"SourceStation" xml:"SourceStation"` }