From 1ffc9c42054e208a01d3e70e6b6f3e1781e798f8 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 5 Apr 2021 17:52:31 +0200 Subject: Moved code around to conform best practices --- navitia_api_client/client.go | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 navitia_api_client/client.go (limited to 'navitia_api_client/client.go') diff --git a/navitia_api_client/client.go b/navitia_api_client/client.go deleted file mode 100644 index aef8d0e..0000000 --- a/navitia_api_client/client.go +++ /dev/null @@ -1,31 +0,0 @@ -package navitia_api_client - -import ( - "fmt" - "net/http" - "sync" - "time" -) - -type Client struct { - baseURL string - httpClient *http.Client - - mutex sync.Mutex - cache map[string]cachedResult -} - -type cachedResult struct { - ts time.Time - result interface{} -} - -func NewClient(token string) *Client { - return &Client{ - baseURL: fmt.Sprintf("https://%s@api.sncf.com/v1", token), - httpClient: &http.Client{ - Timeout: time.Minute, - }, - cache: make(map[string]cachedResult), - } -} -- cgit v1.2.3