Documentation ¶
Index ¶
- type MarketWSClient
- type Subscriber
- type TradeWSClient
- func (client *TradeWSClient) HandleRequest(topic string, obj interface{}, fields ...map[string]interface{}) (*simplejson.Json, error)
- func (client *TradeWSClient) Reconnect()
- func (client *TradeWSClient) Request(topic string, fields ...map[string]interface{}) (*simplejson.Json, error)
- func (client *TradeWSClient) SetAutoReconnect(autoReconnect bool)
- func (client *TradeWSClient) Subscribe(topic string, listener Subscriber) error
- func (client *TradeWSClient) UnSubscribe(topic string)
- type TradeWSV2Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MarketWSClient ¶
type MarketWSClient struct {
// contains filtered or unexported fields
}
func NewMarketWSClient ¶
func NewMarketWSClient() (*MarketWSClient, error)
NewMarketWSClient WebSocket格式行情Client
func (*MarketWSClient) Reconnect ¶
func (client *MarketWSClient) Reconnect()
Reconnect 重新连接,关闭旧链接,建立新链接,重新授权,重新订阅
func (*MarketWSClient) SetAutoReconnect ¶
func (client *MarketWSClient) SetAutoReconnect(autoReconnect bool)
SetAutoReconnect 设置socket中断时自动重新链接,默认true
func (*MarketWSClient) Subscribe ¶
func (client *MarketWSClient) Subscribe(topic string, listener Subscriber) error
Subscribe 订阅主题
func (*MarketWSClient) UnSubscribe ¶
func (client *MarketWSClient) UnSubscribe(topic string)
UnSubscribe 取消订阅主题
type Subscriber ¶
type Subscriber func(topic string, json *simplejson.Json)
type TradeWSClient ¶
type TradeWSClient struct {
// contains filtered or unexported fields
}
func NewTradeWSClient ¶
func NewTradeWSClient(accessKeyID, accessKeySecret string) (*TradeWSClient, error)
NewTradeWSClient WebSocket格式交易Client
func (*TradeWSClient) HandleRequest ¶
func (client *TradeWSClient) HandleRequest(topic string, obj interface{}, fields ...map[string]interface{}) (*simplejson.Json, error)
HandleRequest 将Response解析到obj中
func (*TradeWSClient) Reconnect ¶
func (client *TradeWSClient) Reconnect()
Reconnect 重新连接,关闭旧链接,建立新链接,重新授权,重新订阅
func (*TradeWSClient) Request ¶
func (client *TradeWSClient) Request(topic string, fields ...map[string]interface{}) (*simplejson.Json, error)
Request 一次性类请求,阻塞式返回结果
func (*TradeWSClient) SetAutoReconnect ¶
func (client *TradeWSClient) SetAutoReconnect(autoReconnect bool)
SetAutoReconnect 设置socket中断时自动重新链接,默认true
func (*TradeWSClient) Subscribe ¶
func (client *TradeWSClient) Subscribe(topic string, listener Subscriber) error
Subscribe 订阅主题
func (*TradeWSClient) UnSubscribe ¶
func (client *TradeWSClient) UnSubscribe(topic string)
UnSubscribe 取消订阅主题
type TradeWSV2Client ¶
type TradeWSV2Client struct {
// contains filtered or unexported fields
}
func NewTradeWSV2Client ¶
func NewTradeWSV2Client(accessKeyID, accessKeySecret string) (*TradeWSV2Client, error)
NewTradeWSV2Client WebSocket格式交易Client
func (*TradeWSV2Client) Reconnect ¶
func (client *TradeWSV2Client) Reconnect()
Reconnect 重新连接,关闭旧链接,建立新链接,重新授权,重新订阅
func (*TradeWSV2Client) SetAutoReconnect ¶
func (client *TradeWSV2Client) SetAutoReconnect(autoReconnect bool)
SetAutoReconnect 设置socket中断时自动重新链接,默认true
func (*TradeWSV2Client) Subscribe ¶
func (client *TradeWSV2Client) Subscribe(topic string, listener Subscriber) error
Subscribe 订阅主题
func (*TradeWSV2Client) UnSubscribe ¶
func (client *TradeWSV2Client) UnSubscribe(topic string)
UnSubscribe 取消订阅主题
Click to show internal directories.
Click to hide internal directories.