Documentation
¶
Index ¶
- Constants
- Variables
- func NewError(msg string) error
- func ParseTS(ts int64) time.Time
- func ParseTSStr(str string) (ret time.Time, err error)
- func Signature(secret, method, host, path, query string) string
- type CallParam
- type CodeC
- type Error
- type NotifyTrade
- type Response
- type RestClient
- type RestResponse
- type Tick
- type Trade
- type WSClient
Constants ¶
View Source
const ( Huobi = "huobi" StatusOK = "ok" CodeOK = 200 )
View Source
const ( MethodPing = "ping" MethodPong = "pong" MethodSubscibe = "sub" MethodUnSubscribe = "unsub" )
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"`
UnSub string `json:"unsub,omitempty"`
ID string `json:"id,omitempty"`
}
CallParam carry params which used by huobi websocket sub and pong
type NotifyTrade ¶
type Response ¶
type Response struct {
Ping int `json:"ping,omitempty"`
Ch string `json:"ch,omitempty"`
TS int64 `json:"ts,omitempty"`
Tick json.RawMessage `json:"tick,omitempty"`
ID string `json:"id,omitempty"`
Status string `json:"status,omitempty"`
Subbed string `json:"subbed,omitempty"`
ErrCode string `json:"err-code,omitempty"`
ErrMsg string `json:"err-msg,omitempty"`
}
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)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.