-
Notifications
You must be signed in to change notification settings - Fork 0
/
estimates.go
42 lines (35 loc) · 1.07 KB
/
estimates.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package bart
type RealTimeEstimateService struct{}
func (s *RealTimeEstimateService) Departures(r *EstimateDepartureRequest) (resp EstimateDepartureResponse, err error) {
err = makeRequest("etd.aspx", "etd", r, &resp)
return
}
type EstimateDepartureRequest struct {
Origin string `url:"orig"`
Platform string `url:"plat,omitempty"`
Direction string `url:"dir,omitempty"`
}
type EstimateDepartureResponse struct {
BartResponseMeta
Station DepartureStation `xml:"station"`
}
type DepartureStation struct {
Name string `xml:"name"`
Abbr string `xml:"abbr"`
Departures []Departure `xml:"etd"`
}
type Departure struct {
Destination string `xml:"destination"`
Abbreviation string `xml:"abbreviation"`
Limited int `xml:"limited"`
Estimates []Estimate `xml:"estimate"`
}
type Estimate struct {
Minutes int `xml:"minutes"`
Platform int `xml:"platform"`
Direction string `xml:"direction"`
Length int `xml:"length"`
Color string `xml:"color"`
HexColor string `xml:"hexcolor"`
BikeFlag int `xml:"bikeflag"`
}