Documentation
¶
Index ¶
- func Arrivals(c appengine.Context, w http.ResponseWriter, r *http.Request)
- func CreateDatabase(w http.ResponseWriter, r *http.Request)
- func Routes(c appengine.Context, w http.ResponseWriter, r *http.Request)
- func Stops(c appengine.Context, w http.ResponseWriter, r *http.Request)
- type Arrival
- type ByDistance
- type ByID
- type CalendarException
- type ETA
- type Route
- type SchedInfo
- type Stop
- type StopSlice
- type TimeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Arrivals ¶
/arrivals (endpoint to access arrival information)
Default: nothing returned Paramaters:
stops:comma delimited list of stop numbers (required); Default: "" date: date in RFC822Z format; Default: "currentDate"
Response:
stops: map stopNumber to array of arrival times in RFC822Z
func CreateDatabase ¶
func CreateDatabase(w http.ResponseWriter, r *http.Request)
Sets up datastore to fit current structure -- removes all existing
func Routes ¶
/routes (endpoint to access route information)
Default: returns all routes without detailed stops Paramaters:
names: comma delimited list of route names (optional); Default: "" stops: include stop information ["true" or "false"]; Default: "false" onlyNames: only include route names ["true" or "false"]; Default: "false"
Response:
routes: array of route objects
func Stops ¶
/stops (endpoint to access stop information)
Default: returns all stops Paramaters:
ids: comma delimited list of stop ids (optional); Default: "" lat: latitude for search; Default: "" lng: longitude for search; Default: "" radius: radius in meters to make search; Default: 500 limit: limit the amount of stops returned; Default: none
Response:
stops: array of stops objects -- Sort order different based on paramaters -- location: sorted by distance -- ids: sorted by ids
Types ¶
type Arrival ¶
type Arrival struct { // Key will be an autogenerated incomplete Key (int) // Parent will be Stop associated with this time // Run query to find Route *datastore.Key Scheduled time.Duration // Stored as offset from midnight in US/Pacific IsScheduled bool // true for values with known schedule times -- others are estimates // What days of the week this arrival is valid on Monday bool `json:"-"` Tuesday bool `json:"-"` Wednesday bool `json:"-"` Thursday bool `json:"-"` Friday bool `json:"-"` Saturday bool `json:"-"` Sunday bool `json:"-"` // contains filtered or unexported fields }
type ByDistance ¶
type ByDistance struct{ StopSlice }
func (ByDistance) Less ¶
func (s ByDistance) Less(i, j int) bool
type CalendarException ¶
https://developers.google.com/transit/gtfs/reference?csw=1#calendar_dates_fields
type Route ¶
type Route struct { // Key is autogenerated (int64) -- No need to call directly by key Name string `json:",omitempty"` // Treated the same as route number for most routes AdditionalName string `json:",omitempty"` // More user-friendly (ie BB_N -> Beaver Bus- North) Description string `json:",omitempty"` URL string `json:",omitempty"` // https://developers.google.com/maps/documentation/utilities/polylinealgorithm Polyline string `datastore:",noindex" json:",omitempty"` // Needed due to length Color string `json:",omitempty"` // Route color stored as hexadecimal Direction string `json:",omitempty"` Stops []*datastore.Key `json:"-"` // organized by order travelled Path []*Stop `datastore:"-" json:",omitempty"` // Calculated at runtime Start time.Time `json:"-"` // Begining of validity of arrivals End time.Time `json:"-"` // End of validity of arrivals }
type SchedInfo ¶
type SchedInfo struct {
// contains filtered or unexported fields
}
Temp structure for schedule input
type Stop ¶
type Stop struct { // Key equal to platform number (int) -- same value posted at bus signs ID int64 `datastore:"-"` Name string Road string // Road Name Bearing float64 // Bearing to road AdherancePoint bool // Stops where bus will stop until scheduled departure time Lat float64 Long float64 // Calculated Information Distance float64 `datastore:"-" json:",omitempty"` }
Click to show internal directories.
Click to hide internal directories.