types

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2019 License: ISC Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrWsClosed is the error message when a websocket.(*Conn).Close tries to
	// close an already closed connection. See Go's src/internal/poll/fd.go.
	ErrWsClosed = "use of closed network connection"
)
View Source
var Subscriptions = map[string]HubSignal{
	"newblock":       SigNewBlock,
	"mempool":        SigMempoolUpdate,
	"ping":           SigPingAndUserCount,
	"newtx":          SigNewTx,
	"blockchainSync": SigSyncStatus,
}

Functions

func IsIOTimeoutErr

func IsIOTimeoutErr(err error) bool

IsIOTimeoutErr checks if the passed error indicates an I/O timeout error.

func IsTemporaryErr

func IsTemporaryErr(err error) bool

IsTemporaryErr checks if the passed error indicates a transient error.

func IsWSClosedErr

func IsWSClosedErr(err error) (closedErr bool)

IsWSClosedErr checks if the passed error indicates a closed websocket connection.

Types

type HubSignal

type HubSignal int
const (
	SigSubscribe HubSignal = iota
	SigUnsubscribe
	SigNewBlock
	SigMempoolUpdate
	SigPingAndUserCount
	SigNewTx
	SigSyncStatus
)

func (HubSignal) IsValid

func (s HubSignal) IsValid() bool

func (HubSignal) String

func (s HubSignal) String() string

type TxList

type TxList []*exptypes.MempoolTx

type WebSocketMessage

type WebSocketMessage struct {
	EventId string `json:"event"`
	Message string `json:"message"`
}

WebSocketMessage represents the JSON object used to send and receive typed messages to the web client.

Jump to

Keyboard shortcuts

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