websockets

package
v0.0.0-...-29f1259 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2018 License: BSD-2-Clause Imports: 17 Imported by: 1

Documentation

Overview

Package websockets handles websocket messages and provides a simple websockets server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NotificationBlockHandler

func NotificationBlockHandler(hub *Hub, client *rpcclient.Client, blockID string)

NotificationBlockHandler used to notify blocks

func NotificationMempoolHandler

func NotificationMempoolHandler(hub *Hub, client *rpcclient.Client, txID string)

NotificationMempoolHandler used to notify mempool blocks

func ServeWs

func ServeWs(hub *Hub, w http.ResponseWriter, r *http.Request, rpcClient *rpcclient.Client)

ServeWs handles websocket requests from the peer.

Types

type BroadcastAddressMessage

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

BroadcastAddressMessage used to receive message of addresses

type BroadcastTransactionMessage

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

BroadcastTransactionMessage is used to receive messages of transactions

type Client

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

Client is a middleman between the websocket connection and the hub.

type Hub

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

Hub maintains the set of active clients and broadcasts messages to the clients.

func NewHub

func NewHub() *Hub

NewHub creates a new hub to track messages about clients

func (*Hub) Run

func (h *Hub) Run()

Run runs the hub forever

type RegisterAddress

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

RegisterAddress is a channel used to register an address to a websocket client

type RegisterBloom

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

RegisterBloom is a channel message used to register a bloom filter

Jump to

Keyboard shortcuts

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