Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AllWebSocketMsg = []WebSocketMsgType{ MsgDepth, MsgDepth, MsgLatestPrice, MsgMarketKLine, MsgMarket24H, } )
Functions ¶
This section is empty.
Types ¶
type RedisDepthData ¶
type RedisDepthData struct { Price string `json:"price"` At int64 `json:"at"` Asks [][2]string `json:"asks"` Bids [][2]string `json:"bids"` }
func (*RedisDepthData) JSON ¶
func (r *RedisDepthData) JSON() []byte
type RedisKey ¶
type RedisKey string
const ( FormatNewOrder RedisKey = "{prefix}order.list.{symbol}" FormatCancelOrder RedisKey = "{prefix}need.cancel.{symbol}" FormatTradeResult RedisKey = "{prefix}trade.result.{symbol}" FormatCancelResult RedisKey = "{prefix}cancel.result.{symbol}" FormatQuoteTradeResult RedisKey = "{prefix}quote.trade.result.{symbol}" FormatWsMessage RedisKey = "{prefix}ws.message" FormatDepthData RedisKey = "{prefix}depth.{symbol}" FormatBroadcastLatestPrice RedisKey = "{prefix}broadcast.latest_price.{symbol}" )
type WebSocketMsgType ¶
type WebSocketMsgType string
const ( MsgDepth WebSocketMsgType = "depth.{symbol}" MsgTrade WebSocketMsgType = "trade.{symbol}" MsgLatestPrice WebSocketMsgType = "price.{symbol}" MsgMarketKLine WebSocketMsgType = "kline.{period}.{symbol}" MsgMarket24H WebSocketMsgType = "market.24h.{symbol}" MsgOrderCancel WebSocketMsgType = "order.cancel.{symbol}" MsgToken WebSocketMsgType = "token.{token}" MsgUser WebSocketMsgType = "_user.{user_id}" //特殊的类型,通过后端程序设置的属性 )
Click to show internal directories.
Click to hide internal directories.