Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RPCError ¶
type RPCError struct { Code int64 `json:"code" msgpack:"code"` Message string `json:"message,omitempty" msgpack:"message,omitempty"` }
RPCError represents a JSON-RPC error
type RPCNotification ¶
type RPCNotification struct { ID any `json:"id" msgpack:"id"` Method string `json:"method,omitempty" msgpack:"method,omitempty"` Params []any `json:"params,omitempty" msgpack:"params,omitempty"` }
RPCNotification represents an outgoing JSON-RPC notification
type RPCRawResponse ¶
type RPCRawResponse struct {
// contains filtered or unexported fields
}
func CreateRPCRawResponse ¶
func CreateRPCRawResponse(data []byte) *RPCRawResponse
func (*RPCRawResponse) Error ¶
func (res *RPCRawResponse) Error() error
Error returns the error we discovered in the rpc response, or the error we encountered while decoding
func (*RPCRawResponse) HasError ¶
func (res *RPCRawResponse) HasError() bool
HasError Check if we have an error set
func (*RPCRawResponse) HasInternalError ¶
func (res *RPCRawResponse) HasInternalError() bool
HasInternalError Check if we have an internal error set
func (*RPCRawResponse) Id ¶
func (res *RPCRawResponse) Id() string
func (*RPCRawResponse) RawData ¶
func (res *RPCRawResponse) RawData() []byte
func (*RPCRawResponse) Result ¶
func (res *RPCRawResponse) Result() *RpcResultData
type RPCRequest ¶
type RPCRequest struct { ID any `json:"id" msgpack:"id"` Async bool `json:"async,omitempty" msgpack:"async,omitempty"` Method string `json:"method,omitempty" msgpack:"method,omitempty"` Params []any `json:"params,omitempty" msgpack:"params,omitempty"` }
RPCRequest represents an incoming JSON-RPC request
type RPCResponse ¶
type RPCResponse struct { ID any `json:"id" msgpack:"id"` Error *RPCError `json:"error,omitempty" msgpack:"error,omitempty"` Result any `json:"result,omitempty" msgpack:"result,omitempty"` }
RPCResponse represents an outgoing JSON-RPC response
type RpcResultData ¶
type RpcResultData struct { Result []byte Type jsonparser.ValueType }
type WS ¶ added in v0.0.11
type WS struct {
// contains filtered or unexported fields
}
func NewWebsocket ¶
func NewWebsocket(url string, timeout ...*Config.DbTimeoutConfig) (*WS, error)
func (*WS) NewContext ¶ added in v0.0.11
func (ws *WS) NewContext() (context.Context, context.CancelFunc)
Click to show internal directories.
Click to hide internal directories.