-
Notifications
You must be signed in to change notification settings - Fork 0
/
sdk.go
28 lines (24 loc) · 768 Bytes
/
sdk.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package sdk
import (
"net/http"
)
// ServiceEndpoints contains the url of the different services of ClawIO.
type ServiceEndpoints struct {
AuthServiceBaseURL string
DataServiceBaseURL string
MetaDataServiceBaseURL string
}
// SDK contains services used for talking to different parts of the ClawIO API.
type SDK struct {
Auth AuthService
Data DataService
Meta MetaDataService
}
// New creates a new SDK.
func New(urls *ServiceEndpoints, httpClient *http.Client) *SDK {
sdk := &SDK{}
sdk.Auth = &authService{client: newClient(urls.AuthServiceBaseURL, httpClient)}
sdk.Data = &dataService{client: newClient(urls.DataServiceBaseURL, httpClient)}
sdk.Meta = &metaDataService{client: newClient(urls.MetaDataServiceBaseURL, httpClient)}
return sdk
}