Documentation
¶
Index ¶
Constants ¶
View Source
const ( ParseError = -32700 InvalidRequest = -32600 MethodNotFound = -32601 InvalidParams = -32602 InternalError = -32603 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Notification ¶
type Notification struct {
JSONRPC string `json:"jsonrpc"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
func NewNotification ¶
func NewNotification(method string, params interface{}) (*Notification, error)
type Request ¶
type Request struct {
JSONRPC string `json:"jsonrpc"`
ID json.RawMessage `json:"id"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
type Response ¶
type Response struct {
JSONRPC string `json:"jsonrpc"`
ID json.RawMessage `json:"id"`
Result json.RawMessage `json:"result,omitempty"`
Error *ResponseError `json:"error,omitempty"`
}
func NewErrorResponse ¶
func NewErrorResponse(id json.RawMessage, code int, message string) *Response
func NewResponse ¶
func NewResponse(id json.RawMessage, result interface{}) (*Response, error)
type ResponseError ¶
type ResponseError struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
func (*ResponseError) Error ¶
func (e *ResponseError) Error() string
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func (*Transport) ReadMessage ¶
func (t *Transport) ReadMessage() (json.RawMessage, error)
func (*Transport) WriteMessage ¶
Click to show internal directories.
Click to hide internal directories.