Documentation
¶
Index ¶
- Constants
- func ToJSON(data cborpatch.RawMessage) json.RawMessage
- type Error
- type Handler
- type Request
- func (req *Request) DecodeParams(params interface{}) error
- func (req *Request) Error(err error) *Response
- func (req *Request) Grow(n int)
- func (req *Request) InvalidMethod() *Response
- func (req *Request) InvalidParams(msg string) *Response
- func (req *Request) ReadFrom(r io.Reader) (int64, error)
- func (req *Request) Result(result interface{}) *Response
- func (req *Request) ResultRaw(result cbor.RawMessage) *Response
- func (req *Request) String() string
- type Response
Constants ¶
View Source
const ( CodeParseError = -32700 CodeInvalidRequest = -32600 CodeMethodNotFound = -32601 CodeInvalidParams = -32602 CodeInternalError = -32603 // -32000 to -32599 Server error, Reserved for implementation-defined server-errors. CodeServerError = -32000 )
View Source
const (
MIMEApplicationCBOR = "application/cbor"
)
Variables ¶
This section is empty.
Functions ¶
func ToJSON ¶
func ToJSON(data cborpatch.RawMessage) json.RawMessage
Types ¶
type Error ¶
type Request ¶
type Request struct {
ID string `cbor:"id,omitempty"`
Method string `cbor:"method"`
Params cbor.RawMessage `cbor:"params,omitempty"`
// contains filtered or unexported fields
}
This is a simple implementation of CBOR-RPC. Full reference to https://www.jsonrpc.org/specification
func (*Request) DecodeParams ¶
func (*Request) InvalidMethod ¶
func (*Request) InvalidParams ¶
type Response ¶
type Response struct {
ID string `cbor:"id,omitempty"`
Error *Error `cbor:"error,omitempty"`
Result cbor.RawMessage `cbor:"result,omitempty"`
// contains filtered or unexported fields
}
This is a simple implementation of CBOR-RPC. Full reference to https://www.jsonrpc.org/specification
func (*Response) DecodeResult ¶
Click to show internal directories.
Click to hide internal directories.