Documentation
¶
Index ¶
- type Error
- type Message
- type Request
- func MustNewRequest(method string, inputs ...interface{}) *Request
- func NewRequest(method string, inputs ...interface{}) (*Request, error)
- func NewRequestWithHostID(hostID, method string, inputs ...interface{}) (*Request, error)
- func NewRequestWithID(rawID interface{}, method string, inputs ...interface{}) (*Request, error)
- type Response
- func ExecRPC(url string, req *Request) (*Response, error)
- func ExecRPCBulk(url string, requests []*Request) ([]*Response, error)
- func NewResponse(id json.RawMessage, result interface{}) (*Response, error)
- func NewResponseFromJSON(id, result json.RawMessage) *Response
- func NewResponseWithError(id json.RawMessage, code int, message string) *Response
- type ResponseForced
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Message ¶
type Message struct { ID json.RawMessage `json:"id"` JSONRPC string `json:"jsonrpc"` Method string `json:"method"` Worker string `json:"worker,omitempty"` Params []json.RawMessage `json:"params"` Result json.RawMessage `json:"result"` Error *Error `json:"error,omitempty"` }
func (*Message) ToResponse ¶
type Request ¶
type Request struct { HostID string `json:"-"` ID json.RawMessage `json:"id"` JSONRPC string `json:"jsonrpc"` Method string `json:"method"` Worker string `json:"worker,omitempty"` Params []json.RawMessage `json:"params,omitempty"` }
func MustNewRequest ¶
func NewRequest ¶
func NewRequestWithHostID ¶
func NewRequestWithID ¶
type Response ¶
type Response struct { HostID string `json:"-"` ID json.RawMessage `json:"id"` JSONRPC string `json:"jsonrpc"` Result json.RawMessage `json:"result"` Error *Error `json:"error,omitempty"` }
func NewResponse ¶
func NewResponseFromJSON ¶
func NewResponseFromJSON(id, result json.RawMessage) *Response
func NewResponseWithError ¶
type ResponseForced ¶
func NewResponseForced ¶
func NewResponseForced(id json.RawMessage, result interface{}) (*ResponseForced, error)
func NewResponseForcedFromJSON ¶
func NewResponseForcedFromJSON(id, result json.RawMessage) *ResponseForced
Click to show internal directories.
Click to hide internal directories.