api

package
v0.0.0-...-6501577 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package api provides handlers and methods to process HTTP API requests.

Index

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

HandleWS maintains a websocket connection and pushes content to connected web clients.

Types

type ArrivalWithTrip

type ArrivalWithTrip struct {
	logic.Arrival
	TripShape *logic.TripShape `json:"trip_shape"`
}

ArrivalWithTrip ...

Jump to

Keyboard shortcuts

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