rpc

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2017 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PARSE_ERROR      = -32700
	INVALID_REQUEST  = -32600
	METHOD_NOT_FOUND = -32601
	INVALID_PARAMS   = -32602
	INTERNAL_ERROR   = -32603
)

JSON-RPC 2.0 error codes.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	EncodeBytes(interface{}) ([]byte, error)
	Encode(interface{}, io.Writer) error
	DecodeBytes(interface{}, []byte) error
	Decode(interface{}, io.Reader) error
}

Used for rpc request and response data.

type RPCError

type RPCError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Request and Response objects. Id is a string. Error data not used.

type RPCRequest

type RPCRequest struct {
	JSONRPC string          `json:"jsonrpc"`
	Method  string          `json:"method"`
	Params  json.RawMessage `json:"params"`
	Id      string          `json:"id"`
}

Request and Response objects. Id is a string. Error data not used.

type RPCResponse

type RPCResponse struct {
	Result  interface{} `json:"result"`
	Error   *RPCError   `json:"error"`
	Id      string      `json:"id"`
	JSONRPC string      `json:"jsonrpc"`
}

Request and Response objects. Id is a string. Error data not used.

func NewRPCErrorResponse

func NewRPCErrorResponse(id string, code int, message string) *RPCResponse

Create a new error-response object from the error code and message.

func NewRPCResponse

func NewRPCResponse(id string, res interface{}) *RPCResponse

Create a new response object from a result.

Directories

Path Synopsis
tendermint
v0
shared
Net is part of the pipe for ErisMint and provides the implementation for the pipe to call into the ErisMint application
Net is part of the pipe for ErisMint and provides the implementation for the pipe to call into the ErisMint application

Jump to

Keyboard shortcuts

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