Documentation ¶
Index ¶
Constants ¶
View Source
const ( Huobi = "huobi" StatusOK = "ok" CodeOK = 200 )
View Source
const ( MethodPing = "ping" MethodPong = "pong" MethodSubscibe = "sub" )
Variables ¶
View Source
var ( //SkipError means the response can not be handled directly by Parse method SkipError = errors.New("skip error") )
Functions ¶
Types ¶
type CallParam ¶ added in v0.5.0
type CallParam struct { Pong int `json:"pong,omitempty"` Sub string `json:"sub,omitempty"` ID string `json:"id,omitempty"` }
CallParam carry params which used by huobi websocket sub and pong
type NotifyTrade ¶
type Response ¶
type RestClient ¶
type RestClient struct {
// contains filtered or unexported fields
}
func NewRestClient ¶
func NewRestClient(key, secret, host string) *RestClient
func (*RestClient) Property ¶ added in v0.3.0
func (rc *RestClient) Property() exchange.Property
type RestResponse ¶ added in v0.3.0
type Trade ¶
type Trade struct { Amount float64 `json:"amount"` TS int64 `json:"ts"` ID int64 `json:"id"` TradeID int64 `json:"tradeId"` Price float64 `json:"price"` Direction string `json:"direction"` }
func ParseTrades ¶
func ParseTrades(raw json.RawMessage) ([]Trade, error)
type WSClient ¶ added in v0.5.0
WSClient with auto response ping support
func NewWSClient ¶ added in v0.5.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.