goctranspo

package module
v0.0.0-...-0c7f568 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: MIT Imports: 9 Imported by: 0

README

GOCTranspo

OC Transpo's API written in Golang

Documentation

Overview

NGnius 2020-01-23

NGnius 2020-01-23

NGnius 2020-01-23

NGnius 2020-01-23

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Key   string
	AppID string
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(key string, appID string) *API

func (*API) GTFS

func (api *API) GTFS(table string, id int, column string, value string, order_by string, direction string, limit int) (GTFS, error)

func (*API) GetNextTripsForStop

func (api *API) GetNextTripsForStop(stopNo int, routeNo int) (NextTripsForStop, error)

func (*API) GetNextTripsForStopAllRoutes

func (api *API) GetNextTripsForStopAllRoutes(stopNo int) (NextTripsForStopAllRoutes, error)

func (*API) GetRouteSummaryForStop

func (api *API) GetRouteSummaryForStop(stopNo int, routeNo int) (RouteSummaryForStop, error)

type AdvancedRoute

type AdvancedRoute struct {
	RouteNo      RouteNo
	DirectionID  int
	Direction    string
	RouteHeading string
	Trips        []Trip
}

type GTFS

type GTFS struct {
	Query Query
	Gtfs  []map[string]string
}

type NextTripsForStop

type NextTripsForStop struct {
	StopNo    int
	StopLabel string
	Error     string
	Route     RouteDirection
}

type NextTripsForStopAllRoutes

type NextTripsForStopAllRoutes struct {
	StopNo          int
	StopDescription string
	Error           string
	Routes          []AdvancedRoute
}

type Query

type Query struct {
	Table     string
	Order_By  string
	Direction string
	Column    string
	Value     string
	Limit     int
	Format    string
}

type RouteDirection

type RouteDirection struct {
	RouteNo               RouteNo
	RouteLabel            string
	Direction             string
	Error                 string
	RequestProcessingTime time.Time
	Trips                 []Trip
}

type RouteNo

type RouteNo struct {
	Number         int
	String         string
	IsAlphanumeric bool
}

func NewRouteNo

func NewRouteNo(route string) RouteNo

type RouteSummaryForStop

type RouteSummaryForStop struct {
	StopNo          int
	StopDescription string
	Error           string
	Routes          []SimpleRoute
}

type SimpleRoute

type SimpleRoute struct {
	RouteNo      RouteNo
	DirectionID  int
	Direction    string
	RouteHeading string
}

type Trip

type Trip struct {
	TripDestination      string
	TripStartTime        time.Time
	AdjustedScheduleTime int
	AdjustmentAge        float64
	LastTripOfSchedule   bool
	BusType              string
	Latitude             float64
	Longitude            float64
	GPSSpeed             float64
}

Jump to

Keyboard shortcuts

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