diff options
author | Julien Dessaux | 2021-03-29 00:07:03 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-03-29 00:07:03 +0200 |
commit | dbb4167a49343defa8be01921c3943d7eeb8b9dd (patch) | |
tree | b5eb69c6d4edc46bf6dc851493c6fb957bcecfa2 /navitia_api_client/client.go | |
parent | Moved api test files into their own folder (diff) | |
download | trains-dbb4167a49343defa8be01921c3943d7eeb8b9dd.tar.gz trains-dbb4167a49343defa8be01921c3943d7eeb8b9dd.tar.bz2 trains-dbb4167a49343defa8be01921c3943d7eeb8b9dd.zip |
Renamed the api folder to something more specific
Diffstat (limited to 'navitia_api_client/client.go')
-rw-r--r-- | navitia_api_client/client.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/navitia_api_client/client.go b/navitia_api_client/client.go new file mode 100644 index 0000000..d08ca19 --- /dev/null +++ b/navitia_api_client/client.go @@ -0,0 +1,21 @@ +package navitia_api_client + +import ( + "fmt" + "net/http" + "time" +) + +type Client struct { + baseURL string + httpClient *http.Client +} + +func NewClient(token string) *Client { + return &Client{ + baseURL: fmt.Sprintf("https://%s@api.sncf.com/v1", token), + httpClient: &http.Client{ + Timeout: time.Minute, + }, + } +} |