Documentation ¶
Index ¶
- Constants
- Variables
- func SendBlock2WSclient(v interface{})
- func SendTransaction2WSclient(v interface{})
- func StartServer()
- type Handler
- type Session
- type SessionList
- type WebSocketServer
- func (server *WebSocketServer) IsValidMsg(reqMsg map[string]interface{}) bool
- func (server *WebSocketServer) OnDataHandle(currentSession *Session, bysMsg []byte, r *http.Request) bool
- func (server *WebSocketServer) PushResult(action string, v interface{})
- func (server *WebSocketServer) Start()
- func (server *WebSocketServer) Stop()
Constants ¶
View Source
const SessionTimeOut int64 = 120
Variables ¶
View Source
var ( PushBlockFlag = true PushRawBlockFlag = true PushBlockTxsFlag = true PushNewTxsFlag = true )
Functions ¶
func SendBlock2WSclient ¶
func SendBlock2WSclient(v interface{})
func SendTransaction2WSclient ¶
func SendTransaction2WSclient(v interface{})
func StartServer ¶
func StartServer()
Types ¶
type Session ¶
func (*Session) SessionTimeoverCheck ¶
type SessionList ¶
func (*SessionList) CloseSession ¶
func (sl *SessionList) CloseSession(session *Session)
func (*SessionList) ForEachSession ¶
func (sl *SessionList) ForEachSession(visit func(*Session))
type WebSocketServer ¶
type WebSocketServer struct { sync.RWMutex *http.Server net.Listener websocket.Upgrader SessionList *SessionList ActionMap map[string]Handler }
func (*WebSocketServer) IsValidMsg ¶
func (server *WebSocketServer) IsValidMsg(reqMsg map[string]interface{}) bool
func (*WebSocketServer) OnDataHandle ¶
func (*WebSocketServer) PushResult ¶
func (server *WebSocketServer) PushResult(action string, v interface{})
func (*WebSocketServer) Start ¶
func (server *WebSocketServer) Start()
func (*WebSocketServer) Stop ¶
func (server *WebSocketServer) Stop()
Click to show internal directories.
Click to hide internal directories.