Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package config

import "net/http"

var Host = "api.huobi.pro"
var AccessKey = "xxxx"
var AccountId = "1234"
var SubUid int64 = 5678
var SubUids string = "5678"
var DefaultClient = &http.Client{}
9 changes: 5 additions & 4 deletions internal/httprequest.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package internal

import (
"github.com/huobirdcenter/huobi_golang/logging/perflogger"
"io/ioutil"
"net/http"
"strings"

"github.com/huobirdcenter/huobi_golang/config"
"github.com/huobirdcenter/huobi_golang/logging/perflogger"
)

func HttpGet(url string) (string, error) {
logger := perflogger.GetInstance()
logger.Start()

resp, err := http.Get(url)
resp, err := config.DefaultClient.Get(url)
if err != nil {
return "", err
}
Expand All @@ -27,7 +28,7 @@ func HttpPost(url string, body string) (string, error) {
logger := perflogger.GetInstance()
logger.Start()

resp, err := http.Post(url, "application/json", strings.NewReader(body))
resp, err := config.DefaultClient.Post(url, "application/json", strings.NewReader(body))
if err != nil {
return "", err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/order/cancelorderbyidresponse.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ type CancelOrderByIdResponse struct {
Data string `json:"data"`
ErrorCode string `json:"err-code"`
ErrorMessage string `json:"err-msg"`
OrderState string `json:"order-state"`
OrderState int `json:"order-state"`
}