36 lines
672 B
Go
36 lines
672 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
type Route struct {
|
|
RouteShortName string `json:"route_short_name"`
|
|
RouteLongName string `json:"route_long_name"`
|
|
}
|
|
|
|
type Quay struct {
|
|
ID string `json:"quayid"`
|
|
Name string `json:"name"`
|
|
Town string `json:"town"`
|
|
RoutesOfInterest []Route
|
|
}
|
|
|
|
func (q Quay) IsInterestingDeparture(d Departure) bool {
|
|
for _, route := range q.RoutesOfInterest {
|
|
if (route.RouteShortName == d.RouteShortName) && (route.RouteLongName == d.StopHeadsign) {
|
|
return true
|
|
}
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
var BusClient *http.Client
|
|
var Quays []Quay = []Quay{}
|
|
|
|
func main() {
|
|
BusClient = &http.Client{}
|
|
serveHttp()
|
|
}
|