Documentation ¶
Index ¶
Constants ¶
View Source
const ( //实盘API交易地址如下 WS_PUBLIC common.BaseURL = "wss://ws.okex.com:8443/ws/v5/public" WS_PRIVATE common.BaseURL = "wss://ws.okex.com:8443/ws/v5/private" //AWS 地址如下 AWS_WS_PUBLIC common.BaseURL = "wss://wsaws.okex.com:8443/ws/v5/public" AWS_WS_PRIVATE common.BaseURL = "wss://wsaws.okex.com:8443/ws/v5/private" //模拟盘交易 SIMULATE_WS_PUBLIC common.BaseURL = "wss://wspap.okex.com:8443/ws/v5/public?brokerId=9999" SIMULATE_WS_PRIVATE common.BaseURL = "wss://wspap.okex.com:8443/ws/v5/private?brokerId=9999" )
Endpoint ws地址
Variables ¶
View Source
var ( // UseTestnet 使用测试api UseTestnet = false // UseAWSnet 使用AWS api UseAWSnet = false // WebsocketTimeout is an interval for sending ping/pong messages if WebsocketKeepalive is enabled WebsocketTimeout = time.Second * 25 // WebsocketKeepalive enables sending ping/pong messages to check the connection stability WebsocketKeepalive = false )
Functions ¶
func WebsDepthServe ¶
func WebsDepthServe(symbolLevels []string, handler WebsDepthHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)
WebsDepthServe 获取深度信息
Types ¶
type DepthChannel ¶ added in v1.1.1
type DepthChannel string
DepthChannel 深度频道
const ( DepthBooks DepthChannel = "books" DepthBooks5 DepthChannel = "books5" DepthBooks12tbt DepthChannel = "books-12-tbt" DepthBooks5012tbt DepthChannel = "books50-12-tbt" )
var WebsDepthChannel DepthChannel = DepthBooks5
type DepthParam ¶
DepthParam 深度参数
type WebsDepthEvent ¶
type WebsDepthEvent struct { Symbol string Action string `json:"action"` Ts string `json:"ts"` Bids []Bid `json:"bids"` Asks []Ask `json:"asks"` }
WebsDepthEvent 深度数据
type WebsDepthHandler ¶
type WebsDepthHandler func(event *WebsDepthEvent)
WebsDepthHandler handle websocket partial depth event
Click to show internal directories.
Click to hide internal directories.