Versions in this module Expand all Collapse all v0 v0.38.78 Jul 18, 2023 v0.38.77 Jul 18, 2023 Changes in this version + func SocketType(listenAddr string) string + type Context struct + HTTPReq *http.Request + JSONReq *RPCRequest + WSConn WSRPCConnection + func (ctx *Context) Context() context.Context + func (ctx *Context) RemoteAddr() string + type JSONRPCIntID int + func (id JSONRPCIntID) String() string + type JSONRPCStringID string + func (id JSONRPCStringID) String() string + type RPCError struct + Code int + Data string + Message string + func (err RPCError) Error() string + type RPCRequest struct + ID jsonrpcid + JSONRPC string + Method string + Params json.RawMessage + func ArrayToRequest(id jsonrpcid, method string, params []interface{}) (RPCRequest, error) + func MapToRequest(id jsonrpcid, method string, params map[string]interface{}) (RPCRequest, error) + func NewRPCRequest(id jsonrpcid, method string, params json.RawMessage) RPCRequest + func (req *RPCRequest) UnmarshalJSON(data []byte) error + func (req RPCRequest) String() string + type RPCResponse struct + Error *RPCError + ID jsonrpcid + JSONRPC string + Result json.RawMessage + func NewRPCErrorResponse(id jsonrpcid, code int, msg string, data string) RPCResponse + func NewRPCSuccessResponse(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(err error) RPCResponse + func RPCServerError(id jsonrpcid, err error) RPCResponse + func (resp *RPCResponse) UnmarshalJSON(data []byte) error + func (resp RPCResponse) String() string + type WSRPCConnection interface + Context func() context.Context + GetRemoteAddr func() string + TryWriteRPCResponse func(RPCResponse) bool + WriteRPCResponse func(context.Context, RPCResponse) error