-
Notifications
You must be signed in to change notification settings - Fork 2
/
kahla.go
39 lines (35 loc) · 1018 Bytes
/
kahla.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
29
30
31
32
33
34
35
36
37
38
39
package kahla
import (
"crypto/tls"
"net/http"
"net/http/cookiejar"
)
type Client struct {
client *http.Client
baseUrl string
Auth *AuthService
Conversation *ConversationService
Devices *DevicesService
Files *FilesService
Friendship *FriendshipService
Groups *GroupsService
Oss *OssService
}
func NewClient(baseUrl string, ossUrl string) *Client {
transport := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: transport}
client.Jar, _ = cookiejar.New(nil)
return &Client{
client: client,
baseUrl: baseUrl,
Auth: NewAuthService(client, baseUrl),
Conversation: NewConversationService(client, baseUrl),
Devices: NewDevicesService(client, baseUrl),
Files: NewFilesService(client, baseUrl),
Friendship: NewFriendshipService(client, baseUrl),
Groups: NewGroupsService(client, baseUrl),
Oss: NewOssService(client, ossUrl),
}
}