Documentation ¶
Index ¶
- Constants
- type Handler
- type WsServer
- func (ws *WsServer) Broadcast(data []byte) error
- func (ws *WsServer) GetClientsById(cliendID []byte) []*Session
- func (ws *WsServer) GetNetNode() (protocol.Noder, error)
- func (ws *WsServer) GetWallet() (vault.Wallet, error)
- func (ws *WsServer) IsValidMsg(reqMsg map[string]interface{}) bool
- func (ws *WsServer) NotifyWrongClients()
- func (ws *WsServer) OnDataHandle(curSession *Session, messageType int, bysMsg []byte, r *http.Request) bool
- func (ws *WsServer) PushResult(resp map[string]interface{})
- func (ws *WsServer) PushTxResult(txHashStr string, resp map[string]interface{})
- func (ws *WsServer) Restart()
- func (ws *WsServer) SendRelayPacket(clientId string, msg *client.OutboundMessage)
- func (ws *WsServer) SetTxHashMap(txhash string, sessionid string)
- func (ws *WsServer) Start() error
- func (ws *WsServer) Stop()
Constants ¶
View Source
const (
TlsPort uint16 = 443
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WsServer ¶
type WsServer struct { sync.RWMutex Upgrader websocket.Upgrader SessionList *SessionList ActionMap map[string]Handler TxHashMap map[string]string //key: txHash value:sessionid // contains filtered or unexported fields }
func (*WsServer) GetClientsById ¶
func (*WsServer) IsValidMsg ¶
func (*WsServer) NotifyWrongClients ¶
func (ws *WsServer) NotifyWrongClients()
func (*WsServer) OnDataHandle ¶
func (*WsServer) PushResult ¶
func (*WsServer) PushTxResult ¶
func (*WsServer) SendRelayPacket ¶
func (ws *WsServer) SendRelayPacket(clientId string, msg *client.OutboundMessage)
func (*WsServer) SetTxHashMap ¶
Click to show internal directories.
Click to hide internal directories.