Documentation ¶
Overview ¶
Package api provides handlers and methods to process HTTP API requests.
Index ¶
- func HandleArrivals(sds logic.StopDataset, shds logic.ShapeDataset) http.HandlerFunc
- func HandleRouteLines(sds logic.ShapeDataset) http.HandlerFunc
- func HandleRoutes(rds logic.RouteDataset) http.HandlerFunc
- func HandleShapes(sds logic.ShapeDataset) http.HandlerFunc
- func HandleStops(sd logic.StopDataset) http.HandlerFunc
- func HandleTrimetArrivals(apiKey string) http.HandlerFunc
- func HandleTripUpdates(tds logic.TripUpdatesDataset) http.HandlerFunc
- func HandleVehiclePositions(vd logic.VehicleDataset) http.HandlerFunc
- func HandleWS(vds logic.VehicleDataset, shds logic.ShapeDataset, sds logic.StopDataset, ...) http.HandlerFunc
- type ArrivalWithTrip
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleArrivals ¶
func HandleArrivals(sds logic.StopDataset, shds logic.ShapeDataset) http.HandlerFunc
HandleArrivals returns a list of upcoming arrivals for a list of stops.
func HandleRouteLines ¶
func HandleRouteLines(sds logic.ShapeDataset) http.HandlerFunc
HandleRouteLines returns a list of routelines
func HandleRoutes ¶
func HandleRoutes(rds logic.RouteDataset) http.HandlerFunc
HandleRoutes returns a list of routes
func HandleShapes ¶
func HandleShapes(sds logic.ShapeDataset) http.HandlerFunc
HandleShapes returns a list of shapes
func HandleStops ¶
func HandleStops(sd logic.StopDataset) http.HandlerFunc
HandleStops provides responses for the /api/v1/stops endpoint. It searches for stops within a specified distance from a lat/lon.
func HandleTrimetArrivals ¶
func HandleTrimetArrivals(apiKey string) http.HandlerFunc
HandleTrimetArrivals provides responses for the /api/v1/arrivals endpoint. It proxies requests mostly untouched to the trimet API and returns a list of arrivals for the specified location IDs.
func HandleTripUpdates ¶
func HandleTripUpdates(tds logic.TripUpdatesDataset) http.HandlerFunc
HandleTripUpdates returns a list of trip updates as json
func HandleVehiclePositions ¶
func HandleVehiclePositions(vd logic.VehicleDataset) http.HandlerFunc
HandleVehiclePositions provides responses for the /api/v1/vehicles endpoint. It returns a list of vehicles pulled from a local DB populated from a GTFS feed.
func HandleWS ¶
func HandleWS(vds logic.VehicleDataset, shds logic.ShapeDataset, sds logic.StopDataset, rds logic.RouteDataset) http.HandlerFunc
HandleWS maintains a websocket connection and pushes content to connected web clients.