server

package
v0.7.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2019 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TlsPort uint16 = 443
)

Variables

This section is empty.

Functions

func ResolveDest

func ResolveDest(Dest string) string

Types

type Handler

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

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 InitWsServer

func InitWsServer(localNode *node.LocalNode, wallet vault.Wallet) *WsServer

func (*WsServer) Broadcast

func (ws *WsServer) Broadcast(data []byte) error

func (*WsServer) GetClientsById

func (ws *WsServer) GetClientsById(cliendID []byte) []*Session

func (*WsServer) GetNetNode

func (ws *WsServer) GetNetNode() (*node.LocalNode, error)

func (*WsServer) GetWallet

func (ws *WsServer) GetWallet() (vault.Wallet, error)

func (*WsServer) IsValidMsg

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

func (*WsServer) NotifyWrongClients

func (ws *WsServer) NotifyWrongClients()

func (*WsServer) OnDataHandle

func (ws *WsServer) OnDataHandle(curSession *Session, messageType int, 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