Documentation
¶
Index ¶
- Variables
- type Message
- type MessageTagTpl
- type RecviceTag
- type Response
- type WsManager
- func (m *WsManager) Broadcast(ctx context.Context, _type string, body any) error
- func (m *WsManager) Listen(writer http.ResponseWriter, req *http.Request, responseHeader http.Header)
- func (m *WsManager) SendTo(ctx context.Context, uid string, _type string, body any) error
- func (m *WsManager) SetDebug(v bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AllWebSocketMsg = []MessageTagTpl{ MsgDepthTpl, MsgTradeTpl, MsgLatestPriceTpl, MsgMarketKLineTpl, MsgMarket24HTpl, MsgOrderCancelTpl, MsgNewOrderTpl, } )
Functions ¶
This section is empty.
Types ¶
type Message ¶
func (*Message) ResponseBytes ¶
type MessageTagTpl ¶
type MessageTagTpl string
websocket message tags
const ( MsgDepthTpl MessageTagTpl = "depth.{symbol}" MsgTradeTpl MessageTagTpl = "trade.{symbol}" MsgLatestPriceTpl MessageTagTpl = "price.{symbol}" MsgMarketKLineTpl MessageTagTpl = "kline.{period}.{symbol}" MsgMarket24HTpl MessageTagTpl = "market.24h.{symbol}" MsgOrderCancelTpl MessageTagTpl = "order.cancel.{symbol}" MsgNewOrderTpl MessageTagTpl = "order.new.{symbol}" MsgTokenTpl MessageTagTpl = "token.{token}" MsgUserTpl MessageTagTpl = "_user.{user_id}" //特殊的类型,通过后端程序设置的属性 )
type RecviceTag ¶
Click to show internal directories.
Click to hide internal directories.