respwrap

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResponseWrapper

func ResponseWrapper(cdc *amino.Codec, result interface{}, err error) ([]byte, error)

Types

type RPCError

type RPCError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    string `json:"data,omitempty"`
}

type RPCResponse

type RPCResponse struct {
	JSONRPC string          `json:"jsonrpc"`
	ID      string          `json:"id"`
	Result  json.RawMessage `json:"result,omitempty"`
	Error   *RPCError       `json:"error,omitempty"`
}

func NewRPCErrorResponse

func NewRPCErrorResponse(id string, code int, msg string, data string) RPCResponse

func NewRPCSuccessResponse

func NewRPCSuccessResponse(cdc *amino.Codec, id string, res interface{}) RPCResponse

func RPCInternalError

func RPCInternalError(id string, err error) RPCResponse

Jump to

Keyboard shortcuts

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