Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrStatusCode = errors.New("got non 200 status code") ErrStopNotFound = errors.New("stop not found") ErrRequestFailed = errors.New("request failed") )
View Source
var ( BusEndpoint = Endpoint{ URL: "http://91.223.13.70", Type: pb.Endpoint_BUS, } TramEndpoint = Endpoint{ URL: "http://185.70.182.51", Type: pb.Endpoint_TRAM, } KrkStopsEndpoints = []Endpointer{ BusEndpoint, TramEndpoint, } )
Functions ¶
func GetAllStops ¶
func GetAllStops(e []Endpointer) (chan []pb.Stop, chan error)
GetAllStops returns stops from multiple endpoints. When one endpoint fails, valid stops are returned and error is send via chan. When request is finished, error channel is closed.
func GetDepartures ¶
func GetDepartures(e []Endpointer, shortName uint) (chan []pb.Departure, chan error)
GetDepartures for range of endpoints. When one endpoint fails, valid departures are returned and error is send via chan. When request is finished, error channel is closed.
Types ¶
type Endpoint ¶
func (Endpoint) GetAllStops ¶
GetAllStops fetches Stops from given endpoint.
func (Endpoint) GetDepartures ¶
GetDepartures from Endpoint for stop with given shortName.
Click to show internal directories.
Click to hide internal directories.