Documentation
¶
Index ¶
- func SocketType(listenAddr string) string
- type EventSubscriber
- type RPCError
- type RPCRequest
- type RPCResponse
- func NewRPCErrorResponse(id string, code int, msg string, data string) RPCResponse
- func NewRPCSuccessResponse(cdc *amino.Codec, id string, res interface{}) RPCResponse
- func RPCInternalError(id string, err error) RPCResponse
- func RPCInvalidParamsError(id string, err error) RPCResponse
- func RPCInvalidRequestError(id string, err error) RPCResponse
- func RPCMethodNotFoundError(id string) RPCResponse
- func RPCParseError(id string, err error) RPCResponse
- func RPCServerError(id string, 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 RPCError ¶
type RPCRequest ¶
type RPCRequest struct {
JSONRPC string `json:"jsonrpc"`
ID string `json:"id"`
Method string `json:"method"`
Params json.RawMessage `json:"params"` // must be map[string]interface{} or []interface{}
}
func ArrayToRequest ¶
func MapToRequest ¶
func NewRPCRequest ¶
func NewRPCRequest(id string, method string, params json.RawMessage) RPCRequest
func (RPCRequest) String ¶
func (req RPCRequest) String() string
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
func RPCInvalidParamsError ¶
func RPCInvalidParamsError(id string, err error) RPCResponse
func RPCInvalidRequestError ¶
func RPCInvalidRequestError(id string, err error) RPCResponse
func RPCMethodNotFoundError ¶
func RPCMethodNotFoundError(id string) RPCResponse
func RPCParseError ¶
func RPCParseError(id string, err error) RPCResponse
func RPCServerError ¶
func RPCServerError(id string, err error) RPCResponse
func (RPCResponse) String ¶
func (resp RPCResponse) String() string
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 ¶ added in v0.10.0
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.