Versions in this module Expand all Collapse all v1 v1.0.0 May 26, 2022 Changes in this version + var ErrWSClientQuit = errors.New("Websocket client quit") + var ErrWSInternal = errors.New("Websocket Internal error") + var ErrWSParse = errors.New("Websocket request parsing error") + type NotificationType int + const NTNewTransaction + const NTRawBlockConnected + const NTRawBlockDisconnected + const NTRequestStatus + func (n NotificationType) String() string + type WSClient struct + func NewWebsocketClient(w http.ResponseWriter, r *http.Request, notificationMgr *WSNotificationManager) (*WSClient, error) + func (c *WSClient) Disconnect() + func (c *WSClient) Disconnected() bool + func (c *WSClient) QueueNotification(marshalledJSON []byte) error + func (c *WSClient) SendMessage(marshalledJSON []byte, doneChan chan bool) + func (c *WSClient) Start() + func (c *WSClient) WaitForShutdown() + type WSNotificationManager struct + MaxNumWebsockets int + func NewWsNotificationManager(maxNumWebsockets int, maxNumConcurrentReqs int, chain *protocol.Chain, ...) *WSNotificationManager + func (m *WSNotificationManager) AddClient(wsc *WSClient) + func (m *WSNotificationManager) IsMaxConnect() bool + func (m *WSNotificationManager) NotifyBlockConnected(block *types.Block) + func (m *WSNotificationManager) NotifyBlockDisconnected(block *types.Block) + func (m *WSNotificationManager) NumClients() (n int) + func (m *WSNotificationManager) RegisterBlockUpdates(wsc *WSClient) + func (m *WSNotificationManager) RegisterNewMempoolTxsUpdates(wsc *WSClient) + func (m *WSNotificationManager) RemoveClient(wsc *WSClient) + func (m *WSNotificationManager) Shutdown() + func (m *WSNotificationManager) Start() error + func (m *WSNotificationManager) UnregisterBlockUpdates(wsc *WSClient) + func (m *WSNotificationManager) UnregisterNewMempoolTxsUpdates(wsc *WSClient) + func (m *WSNotificationManager) WaitForShutdown() + type WSRequest struct + Topic string + func NewWSRequest(topic string) *WSRequest + type WSResponse struct + Data interface{} + ErrorDetail string + NotificationType string + func NewWSResponse(notificationType string, data interface{}, err error) *WSResponse