websocket

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

type WsServer

type WsServer struct {
	sync.RWMutex
	Upgrader websocket.Upgrader

	SessionList *session.SessionList
	ActionMap   map[string]Handler
	TxHashMap   map[string]string //key: txHash   value:sessionid
	// contains filtered or unexported fields
}

func InitWsServer

func InitWsServer(checkAccessToken func(string, string) (string, ErrCode, interface{})) *WsServer

func (*WsServer) IsValidMsg

func (ws *WsServer) IsValidMsg(reqMsg map[string]interface{}) bool

func (*WsServer) OnDataHandle

func (ws *WsServer) OnDataHandle(curSession *session.Session, bysMsg []byte, r *http.Request) bool

func (*WsServer) PushResult

func (ws *WsServer) PushResult(resp map[string]interface{})

func (*WsServer) PushTxResult

func (ws *WsServer) PushTxResult(txHashStr string, resp map[string]interface{})

func (*WsServer) Restart

func (ws *WsServer) Restart()

func (*WsServer) SetTxHashMap

func (ws *WsServer) SetTxHashMap(txhash string, sessionid string)

func (*WsServer) Start

func (ws *WsServer) Start() error

func (*WsServer) Stop

func (ws *WsServer) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL