rpc

package
v4.13.0+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	EstablishConnection() (io.ReadWriteCloser, error)
	ServerInfo() *ServerInfo
}

Backend describes the methods provided to connect to an RPC backend

type Client

type Client interface {
	Method(func([]byte) error, func() func(error), string, ...interface{})
	MethodSync(interface{}, string, ...interface{}) error
	SubscribeNotifications(string, func([]byte))
	Close()
	IsClosed() bool
	RegisterHeartbeat(string, ...interface{})
	OnConnect(func() error)
	ConnectionStatus() Status
	RegisterOnConnectionStatusChangedEvent(func(Status))
}

Client describes the methods needed to communicate with an RPC server.

type ServerInfo

type ServerInfo struct {
	Server  string `json:"server"`
	TLS     bool   `json:"tls"`
	PEMCert string `json:"pemCert"`
}

ServerInfo holds information about the backend server(s).

type Status

type Status int

Status is the connection status to the blockchain node

const (
	// CONNECTED indicates that we are online
	CONNECTED Status = iota
	// DISCONNECTED indicates that we are offline
	DISCONNECTED
)

Jump to

Keyboard shortcuts

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