Documentation
¶
Index ¶
- Constants
- Variables
- func SanitiseSeach(search string) string
- type AffectedItems
- type AffectedLines
- type AffectedStops
- type Alert
- type Destination
- type GtfsShapePoint
- type GtfsStopTime
- type GtfsTrip
- type Journey
- type JourneyStop
- type Leg
- type Location
- type Stop
- type StopSearchResult
- type Transportation
- type TripClient
- func (tc *TripClient) FindStop(search string) []StopSearchResult
- func (tc *TripClient) FindStopFirstOrPanic(search string) StopSearchResult
- func (tc *TripClient) GetCurrentAlerts(ctx context.Context) ([]Alert, error)
- func (tc *TripClient) GetJourneyLeg(originStopID, destStopID string) ([][2]float64, error)
- func (tc *TripClient) TripPlan(ctx context.Context, origin string, destination string) ([]Journey, error)
Constants ¶
View Source
const (
SearchStopMaxResults = 25
)
Variables ¶
View Source
var ( ErrServerInternalError = errors.New("internal error") ErrServerNotAuthenticated = errors.New("not authenticated") )
Functions ¶
Types ¶
type AffectedItems ¶
type AffectedItems struct {
Lines []AffectedLines `json:"lines"`
Stops []AffectedStops `json:"stops"`
}
type AffectedLines ¶
type AffectedStops ¶
type Destination ¶
type GtfsShapePoint ¶
type GtfsStopTime ¶
type JourneyStop ¶
type Leg ¶
type Leg struct {
Origin Location `json:"origin"`
Destination Location `json:"destination"`
Duration int `json:"duration"`
Distance int `json:"distance"`
Transportation *Transportation `json:"transportation"`
StopSequence []JourneyStop `json:"stopSequence"`
IsRealtimeControlled bool `json:"isRealtimeControlled"`
}
type Location ¶
type Location struct {
ID string `json:"id"`
Name string `json:"name"`
DisassembledName string `json:"disassembledName"`
ArrivalTimePlanned string `json:"arrivalTimePlanned"`
ArrivalTimeEstimated string `json:"arrivalTimeEstimated"`
DepartureTimePlanned string `json:"departureTimePlanned"`
DepartureTimeEstimated string `json:"departureTimeEstimated"`
Coord []float64 `json:"coord"`
Type string `json:"type"`
}
type StopSearchResult ¶
type Transportation ¶
type TripClient ¶
type TripClient struct {
// contains filtered or unexported fields
}
TripClientV1, for v1 of the API
func NewClient ¶
func NewClient(db *sql.DB) *TripClient
func (*TripClient) FindStop ¶
func (tc *TripClient) FindStop(search string) []StopSearchResult
this should never fail
func (*TripClient) FindStopFirstOrPanic ¶
func (tc *TripClient) FindStopFirstOrPanic(search string) StopSearchResult
func (*TripClient) GetCurrentAlerts ¶
func (tc *TripClient) GetCurrentAlerts(ctx context.Context) ([]Alert, error)
gets only current alerts at the current time for the current day
func (*TripClient) GetJourneyLeg ¶
func (tc *TripClient) GetJourneyLeg(originStopID, destStopID string) ([][2]float64, error)
Click to show internal directories.
Click to hide internal directories.