transportapi

package
v0.0.0-...-e526314 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeparturesRequest

func NewDeparturesRequest(from string) (*http.Request, error)

NewDeparturesRequest returns an HTTP Request object for querying departures from a given station from transportapi.com.

Types

type Response

type Response struct {
	Arrivals    *Trains `json:"arrivals"`
	Date        string  `json:"date"`
	Departures  *Trains `json:"departures"`
	Error       string  `json:"error"`
	RequestTime string  `json:"request_time"`
	StationCode string  `json:"station_code"`
	StationName string  `json:"station_name"`
	TimeOfDay   string  `json:"time_of_day"`
}

func ParseResponse

func ParseResponse(resp *http.Response) (*Response, error)

ParseResponse parses the response from transportapi.com.

type Train

type Train struct {
	AimedArrivalTime          string `json:"aimed_arrival_time"`
	AimedDepartureTime        string `json:"aimed_departure_time"`
	AimedPassTime             string `json:"aimed_pass_time"`
	BestArrivalEstimateMins   int    `json:"best_arrival_estimate_mins"`
	BestDepartureEstimateMins int    `json:"best_departure_estimate_mins"`
	DestinationName           string `json:"destination_name"`
	ExpectedArrivalTime       string `json:"expected_arrival_time"`
	ExpectedDepartureTime     string `json:"expected_departure_time"`
	Mode                      string `json:"mode"`
	Operator                  string `json:"operator"`
	OriginName                string `json:"origin_name"`
	Platform                  string `json:"platform"`
	Service                   string `json:"service"`
	Source                    string `json:"source"`
	Status                    string `json:"status"`
	TrainUID                  string `json:"train_uid"`
}

type Trains

type Trains struct {
	All []*Train `json:"all"`
}

Jump to

Keyboard shortcuts

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