Beispiel #1
0
func GetStation(stationCode string) (*Station, error) {
	target := Station{}
	err := internal.Get("Rail.svc/json/jStationInfo", map[string]string{
		"StationCode": stationCode,
	}, &target)
	return &target, err
}
Beispiel #2
0
func (l Line) GetStations() ([]Station, error) {
	target := Stations{}
	err := internal.Get("Rail.svc/json/jStations", map[string]string{
		"LineCode": l.Code,
	}, &target)
	return target.Stations, err
}
Beispiel #3
0
func GetPredictionsByCodes(codes ...string) (Predictions, error) {
	target := internalPredictions{}
	err := internal.Get(
		fmt.Sprintf("StationPrediction.svc/json/GetPrediction/%s", strings.Join(codes, ",")),
		map[string]string{},
		&target)
	return target.Trains, err
}
Beispiel #4
0
func GetStations() ([]Station, error) {
	target := Stations{}
	err := internal.Get("Rail.svc/json/jStations", map[string]string{}, &target)
	return target.Stations, err
}
Beispiel #5
0
func GetIncidents() (Incidents, error) {
	ret := Incidents{}
	return ret, internal.Get("Incidents.svc/json/Incidents", map[string]string{}, &ret)
}