aboutsummaryrefslogtreecommitdiff
path: root/api/client.go
blob: 79c83148918e085da5fdc2bd61dc0191d00bec81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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,
		},
	}
}