Documentation ¶
Overview ¶
Package websocket privides websocket server handler
Index ¶
- Constants
- type Handler
- type WsServer
- func (self *WsServer) BroadcastToSubscribers(contractAddrs map[string]bool, sub int, resp map[string]interface{})
- func (self *WsServer) InsertTxHashMap(txhash string, sessionid string)
- func (self *WsServer) IsValidMsg(reqMsg map[string]interface{}) bool
- func (self *WsServer) OnDataHandle(curSession *session.Session, bysMsg []byte, r *http.Request) bool
- func (self *WsServer) PushTxResult(contractAddrs map[string]bool, txHashStr string, resp map[string]interface{})
- func (self *WsServer) Restart()
- func (self *WsServer) Start() error
- func (self *WsServer) Stop()
Constants ¶
View Source
const ( WSTOPIC_EVENT = 1 WSTOPIC_JSON_BLOCK = 2 WSTOPIC_RAW_BLOCK = 3 WSTOPIC_TXHASHS = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WsServer ¶
type WsServer struct { sync.RWMutex Upgrader websocket.Upgrader SessionList *session.SessionList // websocket sesseionlist ActionMap map[string]Handler //handler functions TxHashMap map[string]string //key: txHash value:sessionid SubscribeMap map[string]subscribe //key: sessionId value:subscribeInfo // contains filtered or unexported fields }
func (*WsServer) BroadcastToSubscribers ¶
func (*WsServer) InsertTxHashMap ¶
func (*WsServer) IsValidMsg ¶
func (*WsServer) OnDataHandle ¶
func (*WsServer) PushTxResult ¶
Click to show internal directories.
Click to hide internal directories.