ttss

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TtssListStopsURL = [...]string{
	BUS:  "http://91.223.13.70:80/internetservice/geoserviceDispatcher/services/stopinfo/stops",
	TRAM: "http://185.70.182.51:80/internetservice/geoserviceDispatcher/services/stopinfo/stops",
}

TtssListStopsURL deccribes TTSS API endpoints used to fetch all stops. Separate endpoints exists for buses and trams.

View Source
var TtssStopDearturesURLs = [...]string{
	BUS:  "http://91.223.13.70/internetservice/services/passageInfo/stopPassages/stop",
	TRAM: "http://185.70.182.51/internetservice/services/passageInfo/stopPassages/stop",
}

TtssStopDearturesURLs deccribes TTSS API endpoints used to query departures. Separate endpoints exists for buses and trams.

Functions

func GetStopDepartures

func GetStopDepartures(stop *pb.Stop) ([]pb.Departure, error)

GetStopDepartures returns bus and tram StopDepartures from given Stop.

func GetStopDeparturesByURL

func GetStopDeparturesByURL(endp Endpoint, stop *pb.Stop) ([]pb.Departure, error)

GetStopDeparturesByURL fetches Departures from given Stop from given endpoint.

Types

type Departure

type Departure struct {
	PlannedTime        string
	Status             string
	ActualRelativeTime int32
	Direction          string
	PatternText        string
}

Departure describe one Departure - tram or bus from given stop.

type Endpoint

type Endpoint int
const (
	BUS Endpoint = iota
	TRAM
	INVALID
)

type StopDepartures

type StopDepartures struct {
	Actual []Departure
}

StopDepartures includes all departures from given Stop.

type Stops

type Stops map[string]string

Stops ShortName to Name

func GetAllStops

func GetAllStops() (Stops, error)

GetAllStops returns bus and tram stops.

func GetAllStopsByURL

func GetAllStopsByURL(endp Endpoint) (Stops, error)

GetAllStopsByURL fetches Stops from given endpoint.

type TtssStops

type TtssStops struct {
	Stops []pb.Stop
}

TtssStops describes all stops returned by TTSS API

Jump to

Keyboard shortcuts

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