shared

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2015 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminApiName    = "admin"
	EthApiName      = "eth"
	DbApiName       = "db"
	DebugApiName    = "debug"
	MergedApiName   = "merged"
	MinerApiName    = "miner"
	NetApiName      = "net"
	ShhApiName      = "shh"
	TxPoolApiName   = "txpool"
	PersonalApiName = "personal"
	Web3ApiName     = "web3"

	JsonRpcVersion = "2.0"
)

Variables

Functions

func NewDecodeParamError

func NewDecodeParamError(errstr string) error

func NewRpcErrorResponse

func NewRpcErrorResponse(id interface{}, jsonrpcver string, errCode int, err error) *interface{}

Create RPC error response, this allows for custom error codes

func NewRpcResponse

func NewRpcResponse(id interface{}, jsonrpcver string, reply interface{}, err error) *interface{}

Create RPC response

func NewValidationError

func NewValidationError(param string, msg string) error

Types

type DecodeParamError

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

func (*DecodeParamError) Error

func (e *DecodeParamError) Error() string

type ErrorObject

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

RPC error response details

type ErrorResponse

type ErrorResponse struct {
	Id      interface{}  `json:"id"`
	Jsonrpc string       `json:"jsonrpc"`
	Error   *ErrorObject `json:"error"`
}

RPC error response

type EthereumApi

type EthereumApi interface {
	// API identifier
	Name() string

	// API version
	ApiVersion() string

	// Execute the given request and returns the response or an error
	Execute(*Request) (interface{}, error)

	// List of supported RCP methods this API provides
	Methods() []string
}

Ethereum RPC API interface

type InsufficientParamsError

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

func NewInsufficientParamsError

func NewInsufficientParamsError(have int, want int) *InsufficientParamsError

func (*InsufficientParamsError) Error

func (e *InsufficientParamsError) Error() string

type InvalidTypeError

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

func NewInvalidTypeError

func NewInvalidTypeError(method, msg string) *InvalidTypeError

func (*InvalidTypeError) Error

func (e *InvalidTypeError) Error() string

type NotAvailableError

type NotAvailableError struct {
	Method string
	Reason string
}

func NewNotAvailableError

func NewNotAvailableError(method string, reason string) *NotAvailableError

func (*NotAvailableError) Error

func (e *NotAvailableError) Error() string

type NotImplementedError

type NotImplementedError struct {
	Method string
}

func NewNotImplementedError

func NewNotImplementedError(method string) *NotImplementedError

func (*NotImplementedError) Error

func (e *NotImplementedError) Error() string

type Request

type Request struct {
	Id      interface{}     `json:"id"`
	Jsonrpc string          `json:"jsonrpc"`
	Method  string          `json:"method"`
	Params  json.RawMessage `json:"params"`
}

RPC request

type Response

type Response struct {
	Id      interface{} `json:"id"`
	Jsonrpc string      `json:"jsonrpc"`
}

RPC response

type SuccessResponse

type SuccessResponse struct {
	Id      interface{} `json:"id"`
	Jsonrpc string      `json:"jsonrpc"`
	Result  interface{} `json:"result"`
}

RPC success response

type ValidationError

type ValidationError struct {
	ParamName string
	// contains filtered or unexported fields
}

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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