rpc

package
v0.0.0-...-12b389a Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	io.ReadWriteCloser
	SetWriteDeadline(time.Time) error
}

Conn is a subset of the methods of net.Conn which are sufficient for ServerCodec.

type ConnRemoteAddr

type ConnRemoteAddr interface {
	RemoteAddr() string
}

ConnRemoteAddr wraps the RemoteAddr operation, which returns a description of the peer address of a connection. If a Conn also implements ConnRemoteAddr, this description is used in log messages.

type JsonrpcMessage

type JsonrpcMessage struct {
	Version string          `json:"jsonrpc,omitempty"`
	ID      json.RawMessage `json:"id,omitempty"`
	Method  string          `json:"method,omitempty"`
	Params  json.RawMessage `json:"params,omitempty"`
	Error   *jsonError      `json:"error,omitempty"`
	Result  json.RawMessage `json:"result,omitempty"`
}

JsonrpcMessage A value of this type can a JSON-RPC request, notification, successful response or error response. Which one it is depends on the fields.

func (*JsonrpcMessage) ErrorResponse

func (msg *JsonrpcMessage) ErrorResponse(err error) *JsonrpcMessage

ErrorResponse ...

func (*JsonrpcMessage) IsGetBlockByNumber

func (msg *JsonrpcMessage) IsGetBlockByNumber() bool

IsGetBlockByNumber ...

func (*JsonrpcMessage) IsGetTransactionCount

func (msg *JsonrpcMessage) IsGetTransactionCount() bool

IsGetTransactionCount ...

func (*JsonrpcMessage) IsGetTransactionReceipt

func (msg *JsonrpcMessage) IsGetTransactionReceipt() bool

IsGetTransactionReceipt ...

func (*JsonrpcMessage) IsPrivRawTransaction

func (msg *JsonrpcMessage) IsPrivRawTransaction() bool

IsPrivRawTransaction ...

func (*JsonrpcMessage) IsPrivTransaction

func (msg *JsonrpcMessage) IsPrivTransaction() bool

IsPrivTransaction ...

func (*JsonrpcMessage) IsRawTransaction

func (msg *JsonrpcMessage) IsRawTransaction() bool

IsRawTransaction ...

func (*JsonrpcMessage) Response

func (msg *JsonrpcMessage) Response(result interface{}) *JsonrpcMessage

Response ...

func (*JsonrpcMessage) String

func (msg *JsonrpcMessage) String() string

Jump to

Keyboard shortcuts

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