Documentation ¶
Index ¶
- func SocketType(listenAddr string) string
- type EventSubscriber
- type JSONRPCIntID
- type JSONRPCStringID
- type RPCError
- type RPCRequest
- func ArrayToRequest(cdc *amino.Codec, id jsonrpcid, method string, params []interface{}) (RPCRequest, error)
- func MapToRequest(cdc *amino.Codec, id jsonrpcid, method string, params map[string]interface{}) (RPCRequest, error)
- func NewRPCRequest(id jsonrpcid, method string, params json.RawMessage) RPCRequest
- type RPCResponse
- func NewRPCErrorResponse(id jsonrpcid, code int, msg string, data string) RPCResponse
- func NewRPCSuccessResponse(cdc *amino.Codec, id jsonrpcid, res interface{}) RPCResponse
- func RPCInternalError(id jsonrpcid, err error) RPCResponse
- func RPCInvalidParamsError(id jsonrpcid, err error) RPCResponse
- func RPCInvalidRequestError(id jsonrpcid, err error) RPCResponse
- func RPCMethodNotFoundError(id jsonrpcid) RPCResponse
- func RPCParseError(id jsonrpcid, err error) RPCResponse
- func RPCServerError(id jsonrpcid, err error) RPCResponse
- type WSRPCConnection
- type WSRPCContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SocketType ¶
---------------------------------------- SOCKETS
Determine if its a unix or tcp socket. If tcp, must specify the port; `0.0.0.0` will return incorrectly as "unix" since there's no port TODO: deprecate
Types ¶
type EventSubscriber ¶ added in v0.14.0
type EventSubscriber interface { Subscribe(ctx context.Context, subscriber string, query tmpubsub.Query, out chan<- interface{}) error Unsubscribe(ctx context.Context, subscriber string, query tmpubsub.Query) error UnsubscribeAll(ctx context.Context, subscriber string) error }
EventSubscriber mirros tendermint/tendermint/types.EventBusSubscriber
type JSONRPCIntID ¶ added in v0.26.4
type JSONRPCIntID int
JSONRPCIntID a wrapper for JSON-RPC integer IDs
type JSONRPCStringID ¶ added in v0.26.4
type JSONRPCStringID string
JSONRPCStringID a wrapper for JSON-RPC string IDs
type RPCError ¶ added in v0.11.0
type RPCRequest ¶
type RPCRequest struct { JSONRPC string `json:"jsonrpc"` ID jsonrpcid `json:"id"` Method string `json:"method"` Params json.RawMessage `json:"params"` // must be map[string]interface{} or []interface{} }
func ArrayToRequest ¶
func ArrayToRequest(cdc *amino.Codec, id jsonrpcid, method string, params []interface{}) (RPCRequest, error)
func MapToRequest ¶
func NewRPCRequest ¶
func NewRPCRequest(id jsonrpcid, method string, params json.RawMessage) RPCRequest
func (RPCRequest) String ¶ added in v0.10.4
func (req RPCRequest) String() string
func (*RPCRequest) UnmarshalJSON ¶ added in v0.26.4
func (request *RPCRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON custom JSON unmarshalling due to jsonrpcid being string or int
type RPCResponse ¶
type RPCResponse struct { JSONRPC string `json:"jsonrpc"` ID jsonrpcid `json:"id"` Result json.RawMessage `json:"result,omitempty"` Error *RPCError `json:"error,omitempty"` }
func NewRPCErrorResponse ¶ added in v0.11.0
func NewRPCErrorResponse(id jsonrpcid, code int, msg string, data string) RPCResponse
func NewRPCSuccessResponse ¶ added in v0.11.0
func NewRPCSuccessResponse(cdc *amino.Codec, id jsonrpcid, res interface{}) RPCResponse
func RPCInternalError ¶ added in v0.11.0
func RPCInternalError(id jsonrpcid, err error) RPCResponse
func RPCInvalidParamsError ¶ added in v0.11.0
func RPCInvalidParamsError(id jsonrpcid, err error) RPCResponse
func RPCInvalidRequestError ¶ added in v0.11.0
func RPCInvalidRequestError(id jsonrpcid, err error) RPCResponse
func RPCMethodNotFoundError ¶ added in v0.11.0
func RPCMethodNotFoundError(id jsonrpcid) RPCResponse
func RPCParseError ¶ added in v0.11.0
func RPCParseError(id jsonrpcid, err error) RPCResponse
func RPCServerError ¶ added in v0.11.0
func RPCServerError(id jsonrpcid, err error) RPCResponse
func (RPCResponse) String ¶ added in v0.10.4
func (resp RPCResponse) String() string
func (*RPCResponse) UnmarshalJSON ¶ added in v0.26.4
func (response *RPCResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON custom JSON unmarshalling due to jsonrpcid being string or int
type WSRPCConnection ¶
type WSRPCConnection interface { GetRemoteAddr() string WriteRPCResponse(resp RPCResponse) TryWriteRPCResponse(resp RPCResponse) bool GetEventSubscriber() EventSubscriber Codec() *amino.Codec }
*wsConnection implements this interface.
type WSRPCContext ¶
type WSRPCContext struct { Request RPCRequest WSRPCConnection }
websocket-only RPCFuncs take this as the first parameter.
Click to show internal directories.
Click to hide internal directories.