Documentation
¶
Overview ¶
Package jsonrpc exposes part of a JSON-RPC v2 implementation for use by mcp transport authors.
Index ¶
Constants ¶
View Source
const ( // CodeParseError indicates invalid JSON was received by the server. CodeParseError = -32700 // CodeInvalidRequest indicates the JSON sent is not a valid Request object. CodeInvalidRequest = -32600 // CodeMethodNotFound indicates the method does not exist or is not available. CodeMethodNotFound = -32601 // CodeInvalidParams indicates invalid method parameter(s). CodeInvalidParams = -32602 // CodeInternalError indicates an internal JSON-RPC error. CodeInternalError = -32603 )
Standard JSON-RPC 2.0 error codes. See https://www.jsonrpc.org/specification#error_object
Variables ¶
This section is empty.
Functions ¶
func EncodeMessage ¶ added in v0.3.0
EncodeMessage serializes a JSON-RPC message to its wire format.
Types ¶
type Message ¶
Message is a JSON-RPC message.
func DecodeMessage ¶ added in v0.3.0
DecodeMessage deserializes JSON-RPC wire format data into a Message. It returns either a Request or Response based on the message content.
Click to show internal directories.
Click to hide internal directories.