Пример #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
}
Пример #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
}
Пример #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
}
Пример #4
0
func GetStations() ([]Station, error) {
	target := Stations{}
	err := internal.Get("Rail.svc/json/jStations", map[string]string{}, &target)
	return target.Stations, err
}
Пример #5
0
func GetIncidents() (Incidents, error) {
	ret := Incidents{}
	return ret, internal.Get("Incidents.svc/json/Incidents", map[string]string{}, &ret)
}