Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDebugMode ¶ added in v0.0.6
func SetDebugMode(enable bool)
Types ¶
type RpcError ¶
type RpcError struct { Code int `json:"code"` Message string `json:"message"` Data any `json:"data,omitempty"` }
RpcError represents a JSON-RPC error-info.
type RpcRequest ¶
type RpcRequest struct { Jsonrpc string `json:"jsonrpc"` Method string `json:"method"` Params []any `json:"params"` ID int `json:"id"` }
RpcRequest represents a JSON-RPC request.
type RpcResponse ¶
type RpcResponse[RES any] struct { Jsonrpc string `json:"jsonrpc"` ID int `json:"id"` Result RES `json:"result"` Error *RpcError `json:"error,omitempty"` }
RpcResponse represents a JSON-RPC response.
func SendRpc ¶
func SendRpc[RES any](ctx context.Context, serverUrl string, request *RpcRequest) (rpcResponse *RpcResponse[RES], err error)
Click to show internal directories.
Click to hide internal directories.