Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RequestIDLength size of id sent on WS request RequestIDLength = 16 // CloseMessageCode identifier the message id for a close request CloseMessageCode = 1000 // DefaultTimeout timeout in seconds DefaultTimeout = 30 )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type RPCError ¶
type RPCError struct { Code int `json:"code" msgpack:"code"` Message string `json:"message,omitempty" msgpack:"message,omitempty"` }
RPCError represents a JSON-RPC error
type RPCNotification ¶
type RPCNotification struct { ID interface{} `json:"id" msgpack:"id"` Method string `json:"method,omitempty" msgpack:"method,omitempty"` Params []interface{} `json:"params,omitempty" msgpack:"params,omitempty"` }
RPCNotification represents an outgoing JSON-RPC notification
type RPCRequest ¶
type RPCRequest struct { ID interface{} `json:"id" msgpack:"id"` Async bool `json:"async,omitempty" msgpack:"async,omitempty"` Method string `json:"method,omitempty" msgpack:"method,omitempty"` Params []interface{} `json:"params,omitempty" msgpack:"params,omitempty"` }
RPCRequest represents an incoming JSON-RPC request
type RPCResponse ¶
type RPCResponse struct { ID interface{} `json:"id" msgpack:"id"` Error *RPCError `json:"error,omitempty" msgpack:"error,omitempty"` Result interface{} `json:"result,omitempty" msgpack:"result,omitempty"` }
RPCResponse represents an outgoing JSON-RPC response
Click to show internal directories.
Click to hide internal directories.