From bb78fe4cbac510b54d49f41efbdb35ffe7175299 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Thu, 18 Mar 2021 20:12:43 +0100 Subject: Added api module with departures feature --- api/client.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 api/client.go (limited to 'api/client.go') diff --git a/api/client.go b/api/client.go new file mode 100644 index 0000000..79c8314 --- /dev/null +++ b/api/client.go @@ -0,0 +1,21 @@ +package api + +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, + }, + } +} -- cgit v1.2.3