govitia / navitia

A client library in Go for the Navitia API (navitia.io) (v2 WIP)
The Unlicense
6 stars 2 forks source link

Improve the provider selection. #9

Open aabizri opened 7 years ago

aabizri commented 7 years ago

The problem

Currently we implement provider selection through the URL only. However this has the downside that for some providers that restrict some endpoints (like SNCF), we can't stop a request before executing it.

The solution

One way we could do this is move the providers info from URLs to a proper Struct, with information about which endpoints are allowed/disallowed, which will be integrated in Session via a map[string]bool (has O(1) complexity) allowing us not to waste bandwidth.

This may also allow us to have the SSL fingerprints public in those structs, though that's a question for another issue.

As always, I'm open to suggestions.