diff options
Diffstat (limited to '')
-rw-r--r-- | api/client.go | 21 |
1 files changed, 21 insertions, 0 deletions
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, + }, + } +} |