Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bitgetlimited
GitHub Repository: bitgetlimited/v3-bitget-api-sdk
Path: blob/master/bitget-golang-sdk-api/pkg/client/BitgetApiclient.go
518 views
1
package client
2
3
import (
4
"bitget/internal"
5
"bitget/internal/common"
6
)
7
8
type BitgetApiClient struct {
9
BitgetRestClient *common.BitgetRestClient
10
}
11
12
func (p *BitgetApiClient) Init() *BitgetApiClient {
13
p.BitgetRestClient = new(common.BitgetRestClient).Init()
14
return p
15
}
16
17
func (p *BitgetApiClient) Post(url string, params map[string]string) (string, error) {
18
postBody, jsonErr := internal.ToJson(params)
19
if jsonErr != nil {
20
return "", jsonErr
21
}
22
resp, err := p.BitgetRestClient.DoPost(url, postBody)
23
return resp, err
24
}
25
26
func (p *BitgetApiClient) Get(url string, params map[string]string) (string, error) {
27
resp, err := p.BitgetRestClient.DoGet(url, params)
28
return resp, err
29
}
30
31