Documentation ¶
Index ¶
- Constants
- Variables
- func NewWsConfig(channelType ChannelType) *wsConfig
- func SubscribeWsDepthServe(w *wsConfig, symbolLevels []string, channel DepthChannel, ...) (doneC, stopC chan struct{}, err error)
- type ChannelType
- type DepthChannel
- type DepthParam
- type ErrHandler
- type WebsDepthEvent
- type WebsDepthHandler
- type WsHandler
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 ¶
Functions ¶
func NewWsConfig ¶
func NewWsConfig(channelType ChannelType) *wsConfig
func SubscribeWsDepthServe ¶
func SubscribeWsDepthServe(w *wsConfig, symbolLevels []string, channel DepthChannel, handler WebsDepthHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)
SubscribeWsDepthServe 订阅深度信息
Types ¶
type ChannelType ¶
type ChannelType string
const ( PUBLIC ChannelType = "public" PRIVATE ChannelType = "private" )
WsType wps类型
type DepthChannel ¶
type DepthChannel string
DepthChannel 深度频道
const ( DepthBooks DepthChannel = "books" DepthBooks5 DepthChannel = "books5" DepthBooks12tbt DepthChannel = "books-12-tbt" DepthBooks5012tbt DepthChannel = "books50-12-tbt" )
type DepthParam ¶
DepthParam 深度参数
type WebsDepthEvent ¶
type WebsDepthEvent struct { Symbol string Action string `json:"action"` Ts string `json:"ts"` Bids []common.PriceLevel `json:"bids"` Asks []common.PriceLevel `json:"asks"` }
WebsDepthEvent 深度数据
Click to show internal directories.
Click to hide internal directories.