Versions in this module Expand all Collapse all v1 v1.0.0 Dec 26, 2023 Changes in this version + const ApiKeyVersionV2 + var ErrAuth = errors.New("auth error, you should reinitialize client using key and secret") + var NIL = "<nil>" + var SpotAWSBaseURL = "https://api-aws.huobi.pro" + var SpotBaseURL = "https://api.huobi.pro" + var UsdmAWSBaseURL = "https://api.hbdm.vn" + var UsdmBaseURL = "https://api.hbdm.com" + func GZipCompress(input string) ([]byte, error) + func GZipDecompress(input []byte) (string, error) + type DefaultAuthParam struct + AccessKeyId string + Signature string + SignatureMethod string + SignatureVersion string + Timestamp string + type HTTPRequest struct + BaseURL string + Body any + Headers map[string]string + Method string + Path string + Query any + func (h *HTTPRequest) RequestBody() (string, error) + func (h *HTTPRequest) RequestURI() (string, error) + type HTTPResponse struct + Body []byte + Req *HTTPRequest + Resp *http.Response + func NewResponse(request *HTTPRequest, response *http.Response, body []byte) *HTTPResponse + func (r *HTTPResponse) Error() string + func (r *HTTPResponse) ReadBody() ([]byte, error) + func (r *HTTPResponse) ReadJsonBody(v interface{}) error + type HTXClient struct + func NewHTXRestClient(cfg *HTXClientCfg) (*HTXClient, error) + func (htx *HTXClient) CheckAuth() error + func (htx *HTXClient) GenAuthParams() DefaultAuthParam + func (htx *HTXClient) GetBaseURL() string + func (htx *HTXClient) GetDebug() bool + func (htx *HTXClient) GetHeaders() (map[string]string, error) + func (htx *HTXClient) GetKey() string + func (htx *HTXClient) GetSecret() string + func (htx *HTXClient) GetSignVersion() string + func (htx *HTXClient) NormalizeRequestContent(req HTTPRequest, tempQuery any) (string, error) + func (htx *HTXClient) SendHTTPRequest(ctx context.Context, req HTTPRequest) (*HTTPResponse, error) + func (htx *HTXClient) Sign(plain []byte) string + type HTXClientCfg struct + BaseURL string + Debug bool + Key string + Logger *slog.Logger + Secret string + SignVersion string + type V1Response struct + Ch string + Status string + type V2Response struct + Code int + Message string